|
|
@ -34,7 +34,9 @@ import com.yxt.anrui.base.api.basevehicle.*; |
|
|
|
import com.yxt.anrui.base.api.basevehiclemodel.BaseVehicleModelFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehicletempstate.BaseVehicleTempstateDto; |
|
|
|
import com.yxt.anrui.base.api.basevehicletempstate.BaseVehicleTempstateFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehicletempstate.BaseVehicleTempstateVo; |
|
|
|
import com.yxt.anrui.base.common.enums.BillTypeEnum; |
|
|
|
import com.yxt.anrui.base.common.enums.DictCommonEnum; |
|
|
|
import com.yxt.anrui.base.common.utils.Rule; |
|
|
|
import com.yxt.anrui.base.common.utils.domain.BillNo; |
|
|
|
import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign; |
|
|
@ -51,12 +53,10 @@ import com.yxt.anrui.portal.api.dictcommon.DictCommonFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganization; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
|
import com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfoVo; |
|
|
|
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.anrui.portal.api.sysuser.app.AppUserOrgInfoVo; |
|
|
|
import com.yxt.anrui.scm.api.scmexitpermit.ScmExitPermit; |
|
|
|
import com.yxt.anrui.scm.api.scmfile.ScmFile; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegression.*; |
|
|
@ -64,7 +64,6 @@ import com.yxt.anrui.scm.api.scmvehiclegression.flowable.GetNodeQuery; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegression.flowable.GetNodeVo; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegression.flowable.ScmCarTransferTaskQuery; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegression.flowable.SubmitCarTransferDto; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegressionveh.ScmVehicleGressionVeh; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegressionveh.ScmVehicleGressionVehDto; |
|
|
|
import com.yxt.anrui.scm.api.scmvehiclegressionveh.ScmVehicleGressionVehVo; |
|
|
|
import com.yxt.anrui.scm.biz.scmexitpermit.ScmExitPermitService; |
|
|
@ -73,7 +72,6 @@ import com.yxt.anrui.scm.biz.scmvehiclegressionveh.ScmVehicleGressionVehService; |
|
|
|
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.base.utils.WordUtils; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
@ -352,9 +350,6 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
*/ |
|
|
|
private QueryWrapper<AppScmVehicleGressionPageVo> appQueryWrapper(AppScmVehicleGressionPageQuery query) { |
|
|
|
QueryWrapper<AppScmVehicleGressionPageVo> qw = new QueryWrapper<>(); |
|
|
|
// if (StringUtils.isNotBlank(query.getUseOrgSid())) {
|
|
|
|
// qw.eq("svg.useOrgSid", query.getUseOrgSid());
|
|
|
|
// }
|
|
|
|
if (StringUtils.isNotBlank(query.getUserSid())) { |
|
|
|
qw.eq("svg.createBySid", query.getUserSid()); |
|
|
|
} |
|
|
@ -371,8 +366,8 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean saveCarTransferInfo(AppScmVehicleGressionDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
public ResultBean<String> saveCarTransferInfo(AppScmVehicleGressionDto dto) { |
|
|
|
ResultBean<String> rb = ResultBean.fireFail(); |
|
|
|
List<ScmVehicleGressionVehDto> scmVehicleGressionVehDtos = dto.getScmVehicleGressionVehs(); |
|
|
|
if (scmVehicleGressionVehDtos == null) { |
|
|
|
return rb.setMsg("请选择车架号!"); |
|
|
@ -380,66 +375,50 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
if (dto.getLocationSid().equals(dto.getTargetLocationSid())) { |
|
|
|
return rb.setMsg("目标存放地点不能与现存放地点重复!"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(dto.getInsuranceStateKey())) { |
|
|
|
return rb.setMsg("保险状态不能为空"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(dto.getOperator())) { |
|
|
|
return rb.setMsg("经办人不能为空"); |
|
|
|
} |
|
|
|
String s1 = ""; |
|
|
|
String type = "04"; |
|
|
|
String vinNo = ""; |
|
|
|
String userSid = dto.getUserSid(); |
|
|
|
String sid = dto.getSid(); |
|
|
|
//获取用户信息
|
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(userSid); |
|
|
|
if (!userVoResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(userVoResultBean.getMsg()); |
|
|
|
} |
|
|
|
SysUserVo sysUserVo = userVoResultBean.getData(); |
|
|
|
//获取分公司
|
|
|
|
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(userSid).getData(); |
|
|
|
AppUserOrgInfoVo data = sysUserFeign.getUserOrgInfoByUserSid(userSid).getData(); |
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
ScmVehicleGression scmVehicleGression = null; |
|
|
|
if (StringUtils.isBlank(dto.getSid())) { |
|
|
|
scmVehicleGression = new ScmVehicleGression(); |
|
|
|
//获取当天日期
|
|
|
|
String today = DateUtil.today(); |
|
|
|
if (StringUtils.isBlank(sid)) { |
|
|
|
ScmVehicleGression scmVehicleGression = new ScmVehicleGression(); |
|
|
|
BeanUtil.copyProperties(dto, scmVehicleGression, "sid"); |
|
|
|
scmVehicleGression.setHandleState("1"); |
|
|
|
scmVehicleGression.setApplicantName(data.getStaffName()); |
|
|
|
scmVehicleGression.setApplicantDate(simpleDateFormat.format(new Date())); |
|
|
|
scmVehicleGression.setOrgSid(data.getOrgSid()); |
|
|
|
scmVehicleGression.setUseOrgSid(useOrgSid); |
|
|
|
scmVehicleGression.setApplicantName(sysUserVo.getName());//申请人
|
|
|
|
scmVehicleGression.setApplicantDate(today);//申请时间
|
|
|
|
scmVehicleGression.setUseOrgSid(useOrgSid);//分公司sid
|
|
|
|
scmVehicleGression.setCreateBySid(dto.getUserSid()); |
|
|
|
//申请编号规则:单据名称大写首字母+分公司编码+年份+月份+4位顺序号
|
|
|
|
//获取单据名称大写首字母+分公司编码+年份+月份
|
|
|
|
// Map<String, String> stringStringMap = generateBillNo(userSid);
|
|
|
|
String billNo = getApplyCode(dto); |
|
|
|
scmVehicleGression.setHandleState("1"); |
|
|
|
String billNo = getApplyCode(dto);//申请编号
|
|
|
|
scmVehicleGression.setApplicantNo(billNo); |
|
|
|
//存放车架号
|
|
|
|
for (ScmVehicleGressionVehDto scmVehicleGressionVehDto : scmVehicleGressionVehDtos) { |
|
|
|
ScmVehicleGressionVeh scmVehicleGressionVeh = new ScmVehicleGressionVeh(); |
|
|
|
BeanUtil.copyProperties(scmVehicleGressionVehDto, scmVehicleGressionVeh, "sid"); |
|
|
|
vinNo = scmVehicleGressionVehDto.getVehVin(); |
|
|
|
BaseVehicle baseVehicleVo = baseVehicleFeign.selectByVinNoAndOrgSid(vinNo,useOrgSid).getData(); |
|
|
|
scmVehicleGressionVeh.setVehSid(baseVehicleVo.getSid()); |
|
|
|
scmVehicleGressionVeh.setMainSid(scmVehicleGression.getSid()); |
|
|
|
scmVehicleGressionVehService.save(scmVehicleGressionVeh); |
|
|
|
int i = baseMapper.insert(scmVehicleGression); |
|
|
|
sid = scmVehicleGression.getSid(); |
|
|
|
if (i > 0) { |
|
|
|
scmVehicleGressionVehService.saveOrUpdateDto(scmVehicleGressionVehDtos, scmVehicleGression.getSid()); |
|
|
|
} else { |
|
|
|
return rb.setMsg("保存失败"); |
|
|
|
} |
|
|
|
save(scmVehicleGression); |
|
|
|
|
|
|
|
} else { |
|
|
|
scmVehicleGression = fetchBySid(dto.getSid()); |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(sid); |
|
|
|
if (scmVehicleGression == null) { |
|
|
|
return rb.setMsg("该数据不存在"); |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, scmVehicleGression, "sid"); |
|
|
|
updateById(scmVehicleGression); |
|
|
|
BeanUtil.copyProperties(dto, scmVehicleGression); |
|
|
|
baseMapper.updateById(scmVehicleGression); |
|
|
|
scmVehicleGressionVehService.deleteByMainSid(scmVehicleGression.getSid()); |
|
|
|
//存放车架号
|
|
|
|
for (ScmVehicleGressionVehDto scmVehicleGressionVehDto : scmVehicleGressionVehDtos) { |
|
|
|
ScmVehicleGressionVeh scmVehicleGressionVeh = new ScmVehicleGressionVeh(); |
|
|
|
BeanUtil.copyProperties(scmVehicleGressionVehDto, scmVehicleGressionVeh, "sid"); |
|
|
|
vinNo = scmVehicleGressionVehDto.getVehVin(); |
|
|
|
// BaseVehicleVo baseVehicleVo = baseVehicleFeign.selVehicleByVinNo(vinNo).getData();
|
|
|
|
BaseVehicle baseVehicleVo = baseVehicleFeign.selectByVinNoAndOrgSid(vinNo,useOrgSid).getData(); |
|
|
|
scmVehicleGressionVeh.setVehSid(baseVehicleVo.getSid()); |
|
|
|
scmVehicleGressionVeh.setMainSid(scmVehicleGression.getSid()); |
|
|
|
scmVehicleGressionVehService.save(scmVehicleGressionVeh); |
|
|
|
} |
|
|
|
scmVehicleGressionVehService.saveOrUpdateDto(scmVehicleGressionVehDtos, scmVehicleGression.getSid()); |
|
|
|
|
|
|
|
} |
|
|
|
return rb.success().setData(scmVehicleGression.getSid()).setMsg("保存成功"); |
|
|
|
return rb.success().setData(sid); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -448,8 +427,32 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
* @param sid |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public AppScmVehicleGressionInfoVo getCarTransferInfo(String sid, String userSid) { |
|
|
|
String type1 = "04"; //保单照片
|
|
|
|
public ResultBean<AppScmVehicleGressionInfoVo> getCarTransferInfo(String sid, String userSid) { |
|
|
|
ResultBean<AppScmVehicleGressionInfoVo> rb = ResultBean.fireFail(); |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(sid); |
|
|
|
if (scmVehicleGression == null) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
AppScmVehicleGressionInfoVo vo = baseMapper.getCarTransferInfo(sid); |
|
|
|
List<ScmVehicleGressionVehVo> scmVehicleGressionVehVos = scmVehicleGressionVehService.selectInfoVoByMainSid(sid); |
|
|
|
vo.setScmVehicleGressionVehs(scmVehicleGressionVehVos); |
|
|
|
//保单照片查询
|
|
|
|
List<ScmFile> scmFiles1 = scmFileService.selectByLinkSid(sid, DictCommonEnum.ScmFileType.BD_IMAGE.getCode()); |
|
|
|
List<String> policyImage = new ArrayList<>(); |
|
|
|
for (ScmFile scmFile : scmFiles1) { |
|
|
|
policyImage.add(fileUploadComponent.getUrlPrefix() + scmFile.getFilePath()); |
|
|
|
} |
|
|
|
vo.setPolicyImage(policyImage); |
|
|
|
//现场照片查询
|
|
|
|
List<ScmFile> scmFiles2 = scmFileService.selectByLinkSid(sid, DictCommonEnum.ScmFileType.XC_IMAGE.getCode()); |
|
|
|
List<String> image = new ArrayList<>(); |
|
|
|
for (ScmFile scmFile : scmFiles2) { |
|
|
|
policyImage.add(fileUploadComponent.getUrlPrefix() + scmFile.getFilePath()); |
|
|
|
} |
|
|
|
vo.setImage(image); |
|
|
|
return rb.success().setData(vo); |
|
|
|
|
|
|
|
/* String type1 = "04"; //保单照片
|
|
|
|
String type2 = "05"; //现场照片
|
|
|
|
List<String> policyImage = new ArrayList<>(); |
|
|
|
List<String> image = new ArrayList<>(); |
|
|
@ -457,8 +460,6 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
AppUserOrgInfoVo data = sysUserFeign.getUserOrgInfoByUserSid(userSid).getData(); |
|
|
|
SysStaffinfoVo data1 = sysUserFeign.getSysUserByMobile(data.getStaffSid()).getData(); |
|
|
|
AppScmVehicleGressionInfoVo vo = baseMapper.getCarTransferInfo(sid, useOrgSid); |
|
|
|
// List<String> vins = scmVehicleGressionVehService.fetchVoByMainSid(sid);
|
|
|
|
// vo.setVins(vins);
|
|
|
|
List<ScmVehicleGressionVehVo> scmVehicleGressionVehVos = scmVehicleGressionVehService.selectInfoVoByMainSid(sid); |
|
|
|
vo.setScmVehicleGressionVehs(scmVehicleGressionVehVos); |
|
|
|
vo.setApplicantName(data1.getName()); |
|
|
@ -476,7 +477,7 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
policyImage.add(fileUploadComponent.getUrlPrefix() + scmFile.getFilePath()); |
|
|
|
} |
|
|
|
vo.setImage(image); |
|
|
|
return vo; |
|
|
|
return vo;*/ |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -485,20 +486,41 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
* @param sid |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public AppScmVehicleGressionDetailsVo getCarTransfer(String sid) { |
|
|
|
String type1 = "04"; //保单照片
|
|
|
|
String type2 = "05"; //现场照片
|
|
|
|
List<String> policyImage = new ArrayList<>(); |
|
|
|
List<String> image = new ArrayList<>(); |
|
|
|
public ResultBean<AppScmVehicleGressionDetailsVo> getCarTransfer(String sid) { |
|
|
|
ResultBean<AppScmVehicleGressionDetailsVo> rb = ResultBean.fireFail(); |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(sid); |
|
|
|
if (scmVehicleGression == null) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
AppScmVehicleGressionDetailsVo vo = baseMapper.getCarTransfer(sid); |
|
|
|
List<ScmVehicleGressionVehVo> scmVehicleGressionVehVos = scmVehicleGressionVehService.selectInfoVoByMainSid(sid); |
|
|
|
vo.setScmVehicleGressionVehs(scmVehicleGressionVehVos); |
|
|
|
if ("1".equals(vo.getInsuranceStateKey())) { |
|
|
|
vo.setInsuranceShow(true); |
|
|
|
vo.setInsuranceShow("1".equals(vo.getInsuranceStateKey())); |
|
|
|
vo.setProCardShow("1".equals(vo.getProCardStateKey())); |
|
|
|
List<ScmFile> scmFiles1 = scmFileService.selectByLinkSid(sid, DictCommonEnum.ScmFileType.BD_IMAGE.getCode()); |
|
|
|
List<String> policyImage = new ArrayList<>(); |
|
|
|
if (scmFiles1.size() > 0) { |
|
|
|
for (ScmFile scmFile : scmFiles1) { |
|
|
|
policyImage.add(fileUploadComponent.getUrlPrefix() + scmFile.getFilePath()); |
|
|
|
} |
|
|
|
} |
|
|
|
if ("1".equals(vo.getProCardStateKey())) { |
|
|
|
vo.setProCardShow(true); |
|
|
|
vo.setPolicyImage(policyImage); |
|
|
|
|
|
|
|
List<ScmFile> scmFiles2 = scmFileService.selectByLinkSid(sid, DictCommonEnum.ScmFileType.XC_IMAGE.getCode()); |
|
|
|
List<String> image = new ArrayList<>(); |
|
|
|
if (scmFiles2.size() > 0) { |
|
|
|
for (ScmFile scmFile : scmFiles2) { |
|
|
|
image.add(fileUploadComponent.getUrlPrefix() + scmFile.getFilePath()); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.setImage(image); |
|
|
|
return rb.success().setData(vo); |
|
|
|
|
|
|
|
|
|
|
|
/* String type1 = "04"; //保单照片
|
|
|
|
String type2 = "05"; //现场照片
|
|
|
|
List<String> policyImage = new ArrayList<>(); |
|
|
|
List<String> image = new ArrayList<>(); |
|
|
|
List<String> vins = scmVehicleGressionVehService.fetchVoByMainSid(sid); |
|
|
|
String vin = StringUtils.join(vins, StringUtils.LF); |
|
|
|
vo.setVinNo(vin); |
|
|
@ -518,7 +540,7 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
} |
|
|
|
} |
|
|
|
vo.setImage(image); |
|
|
|
return vo; |
|
|
|
return vo;*/ |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -620,48 +642,6 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
return billNo; |
|
|
|
} |
|
|
|
|
|
|
|
// /**
|
|
|
|
// * 移位单生成编号
|
|
|
|
// *
|
|
|
|
// * @param userSid 用户sid
|
|
|
|
// * @return
|
|
|
|
// */
|
|
|
|
// public Map<String, String> generateBillNo(String userSid) {
|
|
|
|
// List<DictCommonVo> commonVoList = dictCommonFeign.getTypeValues(DictCommonType.BILLSTYPE, "0").getData();
|
|
|
|
// String billsType = "";
|
|
|
|
// if (commonVoList.size() > 0) {
|
|
|
|
// for (int i = 0; i < commonVoList.size(); i++) {
|
|
|
|
// if (commonVoList.get(i).getDictValue().contains("移位单")) {
|
|
|
|
// billsType = commonVoList.get(i).getDictKey();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// AppUserOrgInfoVo userOrgInfo = null;
|
|
|
|
// String orgCode = "";
|
|
|
|
// String orgSid = "";
|
|
|
|
// String orgName = "";
|
|
|
|
// ResultBean<AppUserOrgInfoVo> resultBean = sysUserFeign.getUserOrgInfoByUserSid(userSid);
|
|
|
|
// if (resultBean.getSuccess() && resultBean.getData() != null) {
|
|
|
|
// userOrgInfo = resultBean.getData();
|
|
|
|
// orgSid = userOrgInfo.getOrgSid();
|
|
|
|
// orgName = userOrgInfo.getOrgName();
|
|
|
|
// orgCode = userOrgInfo.getOrgCode();
|
|
|
|
// }
|
|
|
|
// String date = DateUtils.dateConvertStr(new Date(), "yyyy-MM-dd");
|
|
|
|
// // 流水号
|
|
|
|
// int i = selectCountByOrgSid(billsType, date, orgSid);
|
|
|
|
// String num = String.format("%04d", i + 1); // 不足4位补0
|
|
|
|
// Map<String, String> map = new HashMap<>();
|
|
|
|
// map.put("billNo_Num", billsType + orgCode + date.replaceAll("-", "") + num);
|
|
|
|
// map.put("billNo", billsType + orgCode + date.replaceAll("-", ""));
|
|
|
|
// map.put("staffSid", userOrgInfo.getStaffSid());
|
|
|
|
// map.put("staffName", userOrgInfo.getStaffName());
|
|
|
|
// map.put("orgSid", orgSid);
|
|
|
|
// map.put("orgName", orgName);
|
|
|
|
//
|
|
|
|
// return map;
|
|
|
|
// }
|
|
|
|
|
|
|
|
public int selectCountByOrgSid(String billsType, String date, String orgSid) { |
|
|
|
return baseMapper.selectCountByOrgSid(billsType, date, orgSid); |
|
|
|
} |
|
|
@ -694,20 +674,31 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
if (r == 0) { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
String sid = dto.getSid(); |
|
|
|
//存放车架号
|
|
|
|
if (r == 1) { |
|
|
|
List<ScmVehicleGressionVehDto> scmVehicleGressionVehDtos = dto.getScmVehicleGressionVehs(); |
|
|
|
for (ScmVehicleGressionVehDto scmVehicleGressionVehDto : scmVehicleGressionVehDtos) { |
|
|
|
List<String> sids = scmVehicleGressionVehService.fetchVoByVins(scmVehicleGressionVehDto.getVehVin()); |
|
|
|
for (String sid : sids) { |
|
|
|
List<ScmVehicleGressionVo> scmVehicleGressionVos = baseMapper.getlastTimeEqual(sid, dto.getTargetLocationSid()); |
|
|
|
if (scmVehicleGressionVos.size() > 0) { |
|
|
|
if (StringUtils.isNotBlank(scmVehicleGressionVos.get(0).getNodeState())) { |
|
|
|
if (scmVehicleGressionVos.get(0).getNodeState().contains("已办结") || !(scmVehicleGressionVos.get(0).getNodeState().contains("终止")) || !(scmVehicleGressionVos.get(0).getNodeState().contains("申请"))) { |
|
|
|
return rb.setMsg("该申请中" + scmVehicleGressionVehDto.getVehVin() + "已存在,请勿重复提交!"); |
|
|
|
//判断要提交的车辆sid是否存在于临时表中
|
|
|
|
|
|
|
|
List<ScmVehicleGressionVehDto> scmVehicleGressionVehDtos = dto.getScmVehicleGressionVehs(); |
|
|
|
for (ScmVehicleGressionVehDto v : scmVehicleGressionVehDtos) { |
|
|
|
List<BaseVehicleTempstateVo> carSidList = baseVehicleTempstateFeign.selectAll("001").getData(); |
|
|
|
for (BaseVehicleTempstateVo vv : carSidList) { |
|
|
|
if (r == 1) { |
|
|
|
List<String> carSidListO = baseVehicleTempstateFeign.selectAllOne("001").getData(); |
|
|
|
if (carSidListO.size() > 0) { |
|
|
|
if (carSidListO.contains(sid)) { |
|
|
|
return rb.setMsg("车架号为" + v.getVehVin() + "的车辆存放地点变更正在审批中,不允许提交"); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (!vv.getBusSid().equals(scmVehicleGression.getSid())) { |
|
|
|
List<String> carSidListO = baseVehicleTempstateFeign.selectAllOne("001").getData(); |
|
|
|
if (carSidListO.size() > 0) { |
|
|
|
if (carSidListO.contains(sid)) { |
|
|
|
return rb.setMsg("车架号为" + v.getVehVin() + "的车辆存放地点变更正在审批中,不允许提交"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -721,17 +712,16 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
String state = "2"; |
|
|
|
baseMapper.updateStateBySid(businessSid, state); |
|
|
|
//推送车辆移库状态
|
|
|
|
List<String> vinList = scmVehicleGressionVehService.fetchVoByMainSid(businessSid); |
|
|
|
if (vinList.size() > 0) { |
|
|
|
for (String s : vinList) { |
|
|
|
BaseVehicle baseVehicleVo = baseVehicleFeign.selectByVinNoAndOrgSid(s,scmVehicleGression.getUseOrgSid()).getData(); |
|
|
|
// BaseVehicleVo baseVehicleVo = baseVehicleFeign.selVehicleByVinNo(s).getData();
|
|
|
|
BaseVehicleTempstateDto baseVehicleTempstateDto = new BaseVehicleTempstateDto(); |
|
|
|
baseVehicleTempstateDto.setVehSid(baseVehicleVo.getSid()); |
|
|
|
baseVehicleTempstateDto.setTempStateKey("001"); |
|
|
|
baseVehicleTempstateDto.setBusSid(businessSid); |
|
|
|
baseVehicleTempstateFeign.save(baseVehicleTempstateDto); |
|
|
|
} |
|
|
|
List<ScmVehicleGressionVehVo> vinList = scmVehicleGressionVehService.selectInfoVoByMainSid(businessSid); |
|
|
|
vinList.removeAll(Collections.singleton(null)); |
|
|
|
//先删除掉该申请的车
|
|
|
|
baseVehicleTempstateFeign.delByBusSid(businessSid); |
|
|
|
for (ScmVehicleGressionVehVo v : vinList) { |
|
|
|
BaseVehicleTempstateDto baseVehicleTempstateDto = new BaseVehicleTempstateDto(); |
|
|
|
BeanUtil.copyProperties(v, baseVehicleTempstateDto, "sid"); |
|
|
|
baseVehicleTempstateDto.setTempStateKey("001"); |
|
|
|
baseVehicleTempstateDto.setBusSid(businessSid); |
|
|
|
baseVehicleTempstateFeign.save(baseVehicleTempstateDto); |
|
|
|
} |
|
|
|
//创建BusinessVariables实体对象
|
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
@ -1015,6 +1005,8 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
List<String> receiveSidList = Arrays.asList(nextNodeUserSids.split(",")); |
|
|
|
if (receiveSidList.size() == 1 && receiveSidList.get(0).equals(scmVehicleGression.getCreateBySid())) { |
|
|
|
messageFlowableQuery.setMsgContent("您提交的" + messageFlowableQuery.getModuleName() + "已被驳回,请重新提交"); |
|
|
|
//清除临时车辆表状态
|
|
|
|
baseVehicleTempstateFeign.delByBusSid(query.getBusinessSid()); |
|
|
|
} else { |
|
|
|
messageFlowableQuery.setMsgContent(scmVehicleGression.getApplicantName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
} |
|
|
@ -1172,7 +1164,7 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
return rb.success().setData(temporaryExitPermitInfo); |
|
|
|
} |
|
|
|
|
|
|
|
public String createPdf(String sid) { |
|
|
|
/*public String createPdf(String sid) { |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(sid); |
|
|
|
SysOrganization sysOrganization = sysOrganizationFeign.selectBySid(scmVehicleGression.getUseOrgSid()).getData(); |
|
|
|
BaseVehicleSelectVo data = baseVehicleFeign.details(scmVehicleGression.getVehicleSid()).getData(); |
|
|
@ -1184,7 +1176,8 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
dataMap.put("name", "—"); |
|
|
|
dataMap.put("modelName", exiCarConfigDetailVo.getVehicleAlias() + exiCarConfigDetailVo.getCarColor()); |
|
|
|
dataMap.put("number", 1); |
|
|
|
dataMap.put("vinNo", scmVehicleGression.getVinNo()); |
|
|
|
//ToDo:
|
|
|
|
// dataMap.put("vinNo", scmVehicleGression.getVinNo());
|
|
|
|
dataMap.put("reason", "存放地点变更"); |
|
|
|
dataMap.put("operator", scmVehicleGression.getOperator()); |
|
|
|
// dataMap.put("finOperator", "-");
|
|
|
@ -1210,7 +1203,7 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
return "template" + "/" + dateStr + "/" + pdfName; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
public ResultBean<String> getToDoNum(String userSid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|