|
@ -124,6 +124,12 @@ public class ScmCollectionRebateDistributionService extends MybatisBaseService<S |
|
|
return p; |
|
|
return p; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (query.getIsAuit()) { |
|
|
|
|
|
qw.ne("sd.state", 0); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(query.getState())) { |
|
|
|
|
|
qw.eq("sd.state", query.getState()); |
|
|
|
|
|
} |
|
|
if (StringUtils.isNotBlank(query.getCreateOrgName())) { |
|
|
if (StringUtils.isNotBlank(query.getCreateOrgName())) { |
|
|
qw.like("sd.createOrgName", query.getCreateOrgName()); |
|
|
qw.like("sd.createOrgName", query.getCreateOrgName()); |
|
|
} |
|
|
} |
|
@ -138,6 +144,7 @@ public class ScmCollectionRebateDistributionService extends MybatisBaseService<S |
|
|
qw.apply(StringUtils.isNotBlank(subitDateStart), "date_format (sd.subitDate,'%Y-%m-%d') >= date_format('" + subitDateStart + "','%Y-%m-%d')"). |
|
|
qw.apply(StringUtils.isNotBlank(subitDateStart), "date_format (sd.subitDate,'%Y-%m-%d') >= date_format('" + subitDateStart + "','%Y-%m-%d')"). |
|
|
apply(StringUtils.isNotBlank(subitDateEnd), "date_format (sd.subitDate,'%Y-%m-%d') <= date_format('" + subitDateEnd + "','%Y-%m-%d')" |
|
|
apply(StringUtils.isNotBlank(subitDateEnd), "date_format (sd.subitDate,'%Y-%m-%d') <= date_format('" + subitDateEnd + "','%Y-%m-%d')" |
|
|
); |
|
|
); |
|
|
|
|
|
qw.groupBy("sd.sid"); |
|
|
IPage<ScmCollectionRebateDistribution> page = PagerUtil.queryToPage(pq); |
|
|
IPage<ScmCollectionRebateDistribution> page = PagerUtil.queryToPage(pq); |
|
|
IPage<ScmCollectionRebateDistributionVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
IPage<ScmCollectionRebateDistributionVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
PagerVo<ScmCollectionRebateDistributionVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
PagerVo<ScmCollectionRebateDistributionVo> p = PagerUtil.pageToVo(pagging, null); |
|
@ -149,9 +156,11 @@ public class ScmCollectionRebateDistributionService extends MybatisBaseService<S |
|
|
String dtoSid = dto.getSid(); |
|
|
String dtoSid = dto.getSid(); |
|
|
List<ScmCollectionRebateDistributionFile> urls = dto.getUrls(); |
|
|
List<ScmCollectionRebateDistributionFile> urls = dto.getUrls(); |
|
|
List<ScmCollectionRebateDistributionVehDto> scmCollectionRebateVehs = dto.getScmCollectionRebateVehs(); |
|
|
List<ScmCollectionRebateDistributionVehDto> scmCollectionRebateVehs = dto.getScmCollectionRebateVehs(); |
|
|
|
|
|
String state = dto.getState(); |
|
|
|
|
|
if ("0".equals(state)) { |
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
String sid = this.insertByDto(dto); |
|
|
String sid = this.insertByDto(dto); |
|
|
if (!scmCollectionRebateVehs.isEmpty()){ |
|
|
if (scmCollectionRebateVehs != null) { |
|
|
for (ScmCollectionRebateDistributionVehDto scmCollectionRebateVehDto : scmCollectionRebateVehs) { |
|
|
for (ScmCollectionRebateDistributionVehDto scmCollectionRebateVehDto : scmCollectionRebateVehs) { |
|
|
scmCollectionRebateVehDto.setMainSid(sid); |
|
|
scmCollectionRebateVehDto.setMainSid(sid); |
|
|
scmCollectionRebateDistributionVehService.insertByDto(scmCollectionRebateVehDto); |
|
|
scmCollectionRebateDistributionVehService.insertByDto(scmCollectionRebateVehDto); |
|
@ -173,7 +182,7 @@ public class ScmCollectionRebateDistributionService extends MybatisBaseService<S |
|
|
this.updateByDto(dto); |
|
|
this.updateByDto(dto); |
|
|
scmCollectionRebateDistributionVehService.delByMainSid(dtoSid); |
|
|
scmCollectionRebateDistributionVehService.delByMainSid(dtoSid); |
|
|
scmFileService.delByMainSid(dtoSid); |
|
|
scmFileService.delByMainSid(dtoSid); |
|
|
if (!scmCollectionRebateVehs.isEmpty()){ |
|
|
if (scmCollectionRebateVehs != null) { |
|
|
for (ScmCollectionRebateDistributionVehDto scmCollectionRebateVehDto : scmCollectionRebateVehs) { |
|
|
for (ScmCollectionRebateDistributionVehDto scmCollectionRebateVehDto : scmCollectionRebateVehs) { |
|
|
scmCollectionRebateVehDto.setMainSid(dtoSid); |
|
|
scmCollectionRebateVehDto.setMainSid(dtoSid); |
|
|
scmCollectionRebateDistributionVehService.insertByDto(scmCollectionRebateVehDto); |
|
|
scmCollectionRebateDistributionVehService.insertByDto(scmCollectionRebateVehDto); |
|
@ -187,6 +196,17 @@ public class ScmCollectionRebateDistributionService extends MybatisBaseService<S |
|
|
scmFileService.save(scmFile); |
|
|
scmFileService.save(scmFile); |
|
|
} |
|
|
} |
|
|
return rb.success().setMsg("修改成功"); |
|
|
return rb.success().setMsg("修改成功"); |
|
|
|
|
|
} else if ("1".equals(state)) { |
|
|
|
|
|
baseMapper.updateStateAndSubmitDate(dtoSid, state); |
|
|
|
|
|
return rb.success().setMsg("提交成功"); |
|
|
|
|
|
} else if ("2".equals(state)) { |
|
|
|
|
|
baseMapper.updateState(dtoSid, state); |
|
|
|
|
|
return rb.success().setMsg("确认成功"); |
|
|
|
|
|
} else if ("3".equals(state)) { |
|
|
|
|
|
baseMapper.updateState(dtoSid, state); |
|
|
|
|
|
return rb.success().setMsg("退回成功"); |
|
|
|
|
|
} |
|
|
|
|
|
return rb.success(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public String insertByDto(ScmCollectionRebateDistributionDto dto) { |
|
|
public String insertByDto(ScmCollectionRebateDistributionDto dto) { |
|
@ -223,4 +243,21 @@ public class ScmCollectionRebateDistributionService extends MybatisBaseService<S |
|
|
vo.setUrls(urls); |
|
|
vo.setUrls(urls); |
|
|
return rb.success().setData(vo); |
|
|
return rb.success().setData(vo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean<List<String>> selVinNo() { |
|
|
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
List<String> vinNos = baseMapper.selVinNo(); |
|
|
|
|
|
return rb.success().setData(vinNos); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean delAll(String[] sids) { |
|
|
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
//查询该sid中是否有流程不是待提交的
|
|
|
|
|
|
int count = baseMapper.selectBySid(StringUtils.join(sids, ",")); |
|
|
|
|
|
if (count > 0) { |
|
|
|
|
|
return rb.setMsg("删除的数据中包含已经提交审批的数据,删除失败"); |
|
|
|
|
|
} |
|
|
|
|
|
delBySids(sids); |
|
|
|
|
|
return rb.success(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |