|
|
@ -201,8 +201,11 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
*/ |
|
|
|
private QueryWrapper<ScmVehicleGressionPageVo> pcQueryWrapper(ScmVehicleGressionPageQuery query) { |
|
|
|
QueryWrapper<ScmVehicleGressionPageVo> qw = new QueryWrapper<>(); |
|
|
|
if (StringUtils.isNotBlank(query.getUseOrgSid())) { |
|
|
|
qw.eq("svg.useOrgSid", query.getUseOrgSid()); |
|
|
|
// if (StringUtils.isNotBlank(query.getUseOrgSid())) {
|
|
|
|
// qw.eq("svg.useOrgSid", query.getUseOrgSid());
|
|
|
|
// }
|
|
|
|
if (StringUtils.isNotBlank(query.getUserSid())) { |
|
|
|
qw.eq("svg.createBySid", query.getUserSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getType())) { |
|
|
|
qw.eq("svg.handleState", query.getType()); |
|
|
@ -259,8 +262,11 @@ 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.getUseOrgSid())) {
|
|
|
|
// qw.eq("svg.useOrgSid", query.getUseOrgSid());
|
|
|
|
// }
|
|
|
|
if (StringUtils.isNotBlank(query.getUserSid())) { |
|
|
|
qw.eq("svg.createBySid", query.getUserSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getType())) { |
|
|
|
qw.eq("svg.handleState", query.getType()); |
|
|
@ -306,12 +312,12 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
scmVehicleGression.setApplicantDate(simpleDateFormat.format(new Date())); |
|
|
|
scmVehicleGression.setOrgSid(data.getOrgSid()); |
|
|
|
scmVehicleGression.setUseOrgSid(useOrgSid); |
|
|
|
scmVehicleGression.setCreateBySid(dto.getUserSid()); |
|
|
|
//申请编号规则:单据名称大写首字母+分公司编码+年份+月份+4位顺序号
|
|
|
|
//获取单据名称大写首字母+分公司编码+年份+月份
|
|
|
|
// Map<String, String> stringStringMap = generateBillNo(userSid);
|
|
|
|
String billNo = getApplyCode(dto); |
|
|
|
scmVehicleGression.setApplicantNo(billNo); |
|
|
|
save(scmVehicleGression); |
|
|
|
if ("1".equals(dto.getInsuranceStateKey())) { // 如果保单状态为否 不保存保单照片
|
|
|
|
List<String> factoryImage = dto.getPolicyImage(); |
|
|
|
if (factoryImage.size() <= 0) { |
|
|
@ -332,13 +338,13 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
} else if ("0".equals(dto.getInsuranceStateKey())) { |
|
|
|
scmFileService.deleteByLinkSidAndType(scmVehicleGression.getSid(), type); |
|
|
|
} |
|
|
|
save(scmVehicleGression); |
|
|
|
} else { |
|
|
|
scmVehicleGression = fetchBySid(dto.getSid()); |
|
|
|
if (scmVehicleGression == null) { |
|
|
|
return rb.setMsg("该数据不存在"); |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, scmVehicleGression, "sid"); |
|
|
|
updateById(scmVehicleGression); |
|
|
|
if ("1".equals(dto.getInsuranceStateKey())) { // 如果保单状态为否 不保存保单照片
|
|
|
|
List<String> factoryImage = dto.getPolicyImage(); |
|
|
|
if (factoryImage.size() <= 0) { |
|
|
@ -356,6 +362,7 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
scmFile.setLinkSid(scmVehicleGression.getSid()); |
|
|
|
scmFileService.save(scmFile); |
|
|
|
} |
|
|
|
updateById(scmVehicleGression); |
|
|
|
} else if ("0".equals(dto.getInsuranceStateKey())) { |
|
|
|
scmFileService.deleteByLinkSidAndType(scmVehicleGression.getSid(), type); |
|
|
|
} |
|
|
@ -565,6 +572,14 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
if (r == 0) { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
List<ScmVehicleGressionVo> scmVehicleGressionVos = baseMapper.getlastTimeEqual(dto.getVinNo(), 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("该申请已存在,请务重复提交!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//新增修改保存
|
|
|
|
ResultBean<String> resultBean = saveCarTransferInfo(dto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
@ -742,6 +757,9 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
*/ |
|
|
|
public ResultBean taskReject(ScmCarTransferTaskQuery query) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isBlank(query.getComment())) { |
|
|
|
return rb.setMsg("意见不能为空"); |
|
|
|
} |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(query.getBusinessSid()); |
|
|
|
if (scmVehicleGression == null) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
@ -809,6 +827,9 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres |
|
|
|
if (StringUtils.isBlank(query.getUserSid())) { |
|
|
|
return rb.setMsg("参数错误:userSid"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(query.getComment())) { |
|
|
|
return rb.setMsg("意见不能为空"); |
|
|
|
} |
|
|
|
ScmVehicleGression scmVehicleGression = fetchBySid(query.getBusinessSid()); |
|
|
|
String businessTaskId = scmVehicleGression.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|