|
@@ -1353,6 +1353,7 @@ public class TaskController extends BladeController {
|
|
vo.setTaskProcessInfo(taskProcessInfo);
|
|
vo.setTaskProcessInfo(taskProcessInfo);
|
|
}
|
|
}
|
|
/*中间计量申请,开工预付款,材料,返回值增加:上报总金额,本期进度款,审计意见*/
|
|
/*中间计量申请,开工预付款,材料,返回值增加:上报总金额,本期进度款,审计意见*/
|
|
|
|
+ /* 再增加报表id,报表类型*/
|
|
if (task.getMeterTaskType() != null && Arrays.asList(1,2,3).contains(task.getMeterTaskType())){
|
|
if (task.getMeterTaskType() != null && Arrays.asList(1,2,3).contains(task.getMeterTaskType())){
|
|
BigDecimal reportAllMoney = null;
|
|
BigDecimal reportAllMoney = null;
|
|
//实时查询上报总金额
|
|
//实时查询上报总金额
|
|
@@ -1366,6 +1367,10 @@ public class TaskController extends BladeController {
|
|
//开工计量
|
|
//开工计量
|
|
reportAllMoney = startPayMeterFormTaskMapper.selectAllMoney(task.getId());
|
|
reportAllMoney = startPayMeterFormTaskMapper.selectAllMoney(task.getId());
|
|
}
|
|
}
|
|
|
|
+ //获取报表id
|
|
|
|
+ Long reportId = this.getReportId(task);
|
|
|
|
+ vo.setReportId(reportId);
|
|
|
|
+ vo.setType(task.getMeterTaskType() == 1 ? 0 : 1);
|
|
if (reportAllMoney == null || reportAllMoney.compareTo(BigDecimal.ZERO) == 0){
|
|
if (reportAllMoney == null || reportAllMoney.compareTo(BigDecimal.ZERO) == 0){
|
|
throw new ServiceException("上报金额不能为0");
|
|
throw new ServiceException("上报金额不能为0");
|
|
}
|
|
}
|
|
@@ -1590,6 +1595,65 @@ public class TaskController extends BladeController {
|
|
return R.data(200, vo, "操作成功");
|
|
return R.data(200, vo, "操作成功");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 根据当前的任务,查看是否存在对应报表,不存在则新增,返回报表id
|
|
|
|
+ * @param task
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private Long getReportId(Task task){
|
|
|
|
+ Integer type = task.getMeterTaskType();
|
|
|
|
+ if (type == 1) {
|
|
|
|
+ List<InterimPayCertificate> list = interimPayCertificateService.list(
|
|
|
|
+ new LambdaQueryWrapper<InterimPayCertificate>()
|
|
|
|
+ .eq(InterimPayCertificate::getContractPeriodId, task.getFormDataId()));
|
|
|
|
+ if (list.size() > 1) {
|
|
|
|
+ throw new ServiceException("当前计量期获取出多条对应报表");
|
|
|
|
+ } else if (list.size() == 1) {
|
|
|
|
+ return list.get(0).getId();
|
|
|
|
+ } else {
|
|
|
|
+ ContractMeterPeriod period = contractMeterPeriodService.getById(task.getFormDataId());
|
|
|
|
+ //新增报表
|
|
|
|
+ InterimPayCertificate certificate = new InterimPayCertificate();
|
|
|
|
+ certificate.setId(SnowFlakeUtil.getId());
|
|
|
|
+ certificate.setProjectId(period.getProjectId());
|
|
|
|
+ certificate.setContractId(period.getContractId());
|
|
|
|
+ certificate.setContractPeriodId(period.getId());
|
|
|
|
+ certificate.setPeriodNumber(period.getPeriodNumber());
|
|
|
|
+ certificate.setStartDate(period.getStartDate());
|
|
|
|
+ certificate.setEndDate(period.getEndDate());
|
|
|
|
+ certificate.setPrintDate(period.getFormPrintDate());
|
|
|
|
+ interimPayCertificateService.save(certificate);
|
|
|
|
+ this.calculate(certificate.getId()+"",0);
|
|
|
|
+ return certificate.getId();
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ List<MaterialStartStatement> list = materialStartStatementService.list(
|
|
|
|
+ new LambdaQueryWrapper<MaterialStartStatement>()
|
|
|
|
+ .eq(MaterialStartStatement::getMeterPeriodId, task.getFormDataId()));
|
|
|
|
+ if (list.size() > 1) {
|
|
|
|
+ throw new ServiceException("当前计量期获取出多条对应报表");
|
|
|
|
+ } else if (list.size() == 1) {
|
|
|
|
+ return list.get(0).getId();
|
|
|
|
+ } else {
|
|
|
|
+ MeterPeriod period = meterPeriodMapper.selectById(task.getFormDataId());
|
|
|
|
+ //新增报表
|
|
|
|
+ MaterialStartStatement statement = new MaterialStartStatement();
|
|
|
|
+ statement.setId(SnowFlakeUtil.getId());
|
|
|
|
+ statement.setPeriodNumber(period.getPeriodNumber());
|
|
|
|
+ statement.setProjectId(period.getProjectId());
|
|
|
|
+ statement.setContractId(period.getContractId());
|
|
|
|
+ statement.setMeterPeriodId(period.getId());
|
|
|
|
+ statement.setType(type == 2?1:2);
|
|
|
|
+ statement.setStatementName(period.getPeriodName()+"报表");
|
|
|
|
+ statement.setStatementPeriod(period.getPeriodName());
|
|
|
|
+ statement.setPrintDate(period.getFormPrintDate());
|
|
|
|
+ materialStartStatementService.save(statement);
|
|
|
|
+ this.calculate(statement.getId()+"",1);
|
|
|
|
+ return statement.getId();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@GetMapping("/data/detail")
|
|
@GetMapping("/data/detail")
|
|
@ApiOperationSupport(order = 6)
|
|
@ApiOperationSupport(order = 6)
|
|
@ApiOperation(value = "任务数据信息详情", notes = "传入任务id,数据dataId")
|
|
@ApiOperation(value = "任务数据信息详情", notes = "传入任务id,数据dataId")
|