i皖送推送修改
This commit is contained in:
parent
69b7ac41ed
commit
fb6c9bfc51
|
|
@ -8,6 +8,8 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
import com.bonus.material.push.domain.IwsCostPushBean;
|
||||
import com.bonus.material.push.domain.vo.IwsCostPushExportVo;
|
||||
import com.bonus.material.push.service.IwsCostPushService;
|
||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
import com.bonus.material.settlement.service.impl.SltAgreementInfoServiceImpl;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
|
@ -36,6 +38,9 @@ public class IwsCostPushController extends BaseController {
|
|||
@Resource
|
||||
private IwsCostPushService iwsCostPushService;
|
||||
|
||||
@Resource
|
||||
private SltAgreementInfoServiceImpl sltAgreementInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询协议推送匹配列表
|
||||
|
|
@ -79,39 +84,116 @@ public class IwsCostPushController extends BaseController {
|
|||
@ApiOperation("导出费用推送审核列表--后端处理")
|
||||
public void exportCostPushList(HttpServletResponse response, IwsCostPushBean obj) {
|
||||
try {
|
||||
// 获取费用推送审核列表
|
||||
List<IwsCostPushBean> list = iwsCostPushService.getCostPushCheckList(obj);
|
||||
|
||||
// 将数据转换为导出对象列表
|
||||
String month = Optional.ofNullable(obj).map(IwsCostPushBean::getMonth).orElse("");
|
||||
List<IwsCostPushExportVo> exportVoList = list.stream()
|
||||
.map(bean -> {
|
||||
IwsCostPushExportVo vo = new IwsCostPushExportVo();
|
||||
BeanUtils.copyProperties(bean, vo);
|
||||
vo.setMonth(Optional.ofNullable(obj).map(IwsCostPushBean::getMonth).orElse(""));
|
||||
vo.setMonth(month); // 直接使用提取的月份
|
||||
return vo;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
ExcelUtil<IwsCostPushExportVo> util = new ExcelUtil<>(IwsCostPushExportVo.class);
|
||||
util.exportExcel(response, exportVoList, "协议推送匹配");
|
||||
// 导出Excel
|
||||
new ExcelUtil<>(IwsCostPushExportVo.class).exportExcel(response, exportVoList, "费用推送审核表");
|
||||
} catch (Exception e) {
|
||||
// 记录异常并抛出自定义异常
|
||||
System.err.println("导出异常 = " + e.getMessage());
|
||||
throw new ServiceException("导出异常,请联系运维人员查询日志");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据协议ID及月份查询当月租赁费用明细
|
||||
* @param obj 查询条件
|
||||
* @return 分页数据
|
||||
*/
|
||||
@GetMapping("/getLeaseCostsByAgreementIdAndMonth")
|
||||
@ApiOperation("根据协议ID及月份查询当月租赁费用明细--分页")
|
||||
@ApiOperation("根据协议ID及月份查询当月租赁费用明细--不分页")
|
||||
public TableDataInfo getLeaseCostsByAgreementIdAndMonth(IwsCostPushBean obj) {
|
||||
if (Objects.isNull(obj) || Objects.isNull(obj.getAgreementId()) || Objects.isNull(obj.getMonth())) {
|
||||
System.err.println("查询信息为空 = " + obj);
|
||||
return getDataTable(Collections.emptyList());
|
||||
}
|
||||
//startPage(); 取消分页
|
||||
try {
|
||||
List<IwsCostPushBean> list = iwsCostPushService.getLeaseCostsByAgreementIdAndMonth(obj);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
System.err.println("数据查询异常 = " + e.getMessage());
|
||||
throw new ServiceException("数据查询异常,请联系运维人员查询日志处理");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据协议ID查询结算的维修费用明细
|
||||
* @param obj 查询条件
|
||||
*/
|
||||
@GetMapping("/getRepairCostsByAgreementId")
|
||||
@ApiOperation("根据协议ID查询维修费用结算明细--不分页")
|
||||
public TableDataInfo getRepairCostsByAgreementId(IwsCostPushBean obj) {
|
||||
if (Objects.isNull(obj) || Objects.isNull(obj.getAgreementId())) {
|
||||
System.err.println("查询信息为空 = " + obj);
|
||||
return getDataTable(Collections.emptyList());
|
||||
}
|
||||
try {
|
||||
SltAgreementInfo sltAgreementInfo = new SltAgreementInfo();
|
||||
sltAgreementInfo.setAgreementId(Long.valueOf(obj.getAgreementId()));
|
||||
List<SltAgreementInfo> repairList = sltAgreementInfoService.getRepairList(sltAgreementInfo);
|
||||
return getDataTable(repairList);
|
||||
} catch (NumberFormatException e) {
|
||||
System.err.println("数据错误 = " + e.getMessage());
|
||||
throw new ServiceException("数据查询异常,请联系运维人员查询日志处理");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据协议ID查询结算的丢失费用明细
|
||||
* @param obj 查询条件
|
||||
*/
|
||||
@GetMapping("/getLoseCostsByAgreementId")
|
||||
@ApiOperation("根据协议ID查询丢失费用结算明细--不分页")
|
||||
public TableDataInfo getLoseCostsByAgreementId(IwsCostPushBean obj) {
|
||||
if (Objects.isNull(obj) || Objects.isNull(obj.getAgreementId())) {
|
||||
System.err.println("查询信息为空 = " + obj);
|
||||
return getDataTable(Collections.emptyList());
|
||||
}
|
||||
SltAgreementInfo sltAgreementInfo = new SltAgreementInfo();
|
||||
try {
|
||||
sltAgreementInfo.setAgreementId(Long.valueOf(obj.getAgreementId()));
|
||||
List<SltAgreementInfo> loseList = sltAgreementInfoService.getLoseList(sltAgreementInfo);
|
||||
return getDataTable(loseList);
|
||||
} catch (NumberFormatException e) {
|
||||
System.err.println("数据错误 = " + e.getMessage());
|
||||
throw new RuntimeException("数据查询异常,请联系运维人员查询日志处理");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据协议ID查询结算的报废费用明细
|
||||
* @param obj 查询条件
|
||||
*/
|
||||
@GetMapping("/getScrapCostsByAgreementId")
|
||||
@ApiOperation("根据协议ID查询报废费用结算明细--不分页")
|
||||
public TableDataInfo getScrapCostsByAgreementId(IwsCostPushBean obj) {
|
||||
if (Objects.isNull(obj) || Objects.isNull(obj.getAgreementId())) {
|
||||
System.err.println("查询信息为空 = " + obj);
|
||||
return getDataTable(Collections.emptyList());
|
||||
}
|
||||
SltAgreementInfo sltAgreementInfo = new SltAgreementInfo();
|
||||
try {
|
||||
sltAgreementInfo.setAgreementId(Long.valueOf(obj.getAgreementId()));
|
||||
List<SltAgreementInfo> scrapList = sltAgreementInfoService.getScrapList(sltAgreementInfo);
|
||||
return getDataTable(scrapList);
|
||||
} catch (NumberFormatException e) {
|
||||
System.err.println("数据错误 = " + e.getMessage());
|
||||
throw new ServiceException("数据查询异常,请联系运维人员查询日志处理");
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/computeTheMonthCost")
|
||||
|
|
|
|||
Loading…
Reference in New Issue