|
@@ -15,6 +15,8 @@ import com.ozs.plan.doman.vo.requestVo.MonthlyReconciliationPageReqVo;
|
|
|
import com.ozs.plan.service.MonthlyReconciliationService;
|
|
|
import com.ozs.system.domain.SysFileInfo;
|
|
|
import com.ozs.system.domain.SysFileRef;
|
|
|
+import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
|
|
|
+import com.ozs.system.service.ISysDeptService;
|
|
|
import com.ozs.system.service.SysFileRefService;
|
|
|
import com.ozs.system.service.SysFileService;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -27,12 +29,13 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.constraints.NotEmpty;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/monthly/reconciliation")
|
|
|
-@Api( tags = ModularConstans.monthly)
|
|
|
+@Api(tags = ModularConstans.monthly)
|
|
|
public class MonthlyReconciliationController extends BaseController {
|
|
|
|
|
|
|
|
@@ -42,6 +45,8 @@ public class MonthlyReconciliationController extends BaseController {
|
|
|
private SysFileRefService sysFileRefService;
|
|
|
@Autowired
|
|
|
private SysFileService sysFileService;
|
|
|
+ @Autowired
|
|
|
+ private ISysDeptService iSysDeptService;
|
|
|
|
|
|
@ApiOperation(value = "分页查询月度对表")
|
|
|
@PostMapping("/page")
|
|
@@ -50,14 +55,14 @@ public class MonthlyReconciliationController extends BaseController {
|
|
|
public AjaxResult page(@NotEmpty(message = "数据为空")
|
|
|
@RequestBody MonthlyReconciliationPageReqVo vo) {
|
|
|
LambdaQueryWrapper<MonthlyReconciliation> lw = new LambdaQueryWrapper<>();
|
|
|
- if(!StringUtils.isBlank(vo.getProjectName())){
|
|
|
- lw.like(MonthlyReconciliation::getProjectName,vo.getProjectName());
|
|
|
+ if (!StringUtils.isBlank(vo.getProjectName())) {
|
|
|
+ lw.like(MonthlyReconciliation::getProjectName, vo.getProjectName());
|
|
|
}
|
|
|
- if(!ObjectUtils.isEmpty(vo.getProjectStatus())){
|
|
|
- lw.eq(MonthlyReconciliation::getProjectStatus,vo.getProjectStatus());
|
|
|
+ if (!ObjectUtils.isEmpty(vo.getProjectStatus())) {
|
|
|
+ lw.eq(MonthlyReconciliation::getProjectStatus, vo.getProjectStatus());
|
|
|
}
|
|
|
- if(!StringUtils.isBlank(vo.getPurchaseServices())){
|
|
|
- lw.eq(MonthlyReconciliation::getPurchaseServices,vo.getPurchaseServices());
|
|
|
+ if (!StringUtils.isBlank(vo.getPurchaseServices())) {
|
|
|
+ lw.eq(MonthlyReconciliation::getPurchaseServices, vo.getPurchaseServices());
|
|
|
}
|
|
|
// if(!ObjectUtils.isEmpty(vo.getStartTime())){
|
|
|
// lw.ge(BaseNotice::getReleaseTime,vo.getStartTime());
|
|
@@ -66,7 +71,16 @@ public class MonthlyReconciliationController extends BaseController {
|
|
|
// lw.le(BaseNotice::getReleaseTime,vo.getEntTime());
|
|
|
// }
|
|
|
IPage<MonthlyReconciliation> page = monthlyReconciliationService.page(new Page<>(vo.getPageNum(), vo.getPageSize()), lw);
|
|
|
-
|
|
|
+ if (!ObjectUtils.isEmpty(page.getRecords())) {
|
|
|
+ page.setRecords(page.getRecords().stream().map(dto -> {
|
|
|
+ Map<String, Object> stringObjectMap = iSysDeptService.selectDeptById(dto.getPurchaseDeptId());
|
|
|
+ if (!ObjectUtils.isEmpty(stringObjectMap)) {
|
|
|
+ SysDeptResponseVo sysDept = (SysDeptResponseVo) stringObjectMap.get("sysDept");
|
|
|
+ dto.setPurchaseDeptName(sysDept.getDeptName());
|
|
|
+ }
|
|
|
+ return dto;
|
|
|
+ }).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
return success(page);
|
|
|
|
|
|
}
|
|
@@ -81,16 +95,21 @@ public class MonthlyReconciliationController extends BaseController {
|
|
|
Long id) {
|
|
|
MonthlyReconciliation vo = monthlyReconciliationService.getById(id);
|
|
|
|
|
|
- if(!ObjectUtils.isEmpty(vo)){
|
|
|
- LambdaQueryWrapper<SysFileRef> lw =new LambdaQueryWrapper();
|
|
|
+ if (!ObjectUtils.isEmpty(vo)) {
|
|
|
+ LambdaQueryWrapper<SysFileRef> lw = new LambdaQueryWrapper();
|
|
|
lw.eq(SysFileRef::getType, SysFileRefEnum.PLAN_TEMPORARY.getType());
|
|
|
- lw.eq(SysFileRef::getRedId,vo.getPlanId());
|
|
|
+ lw.eq(SysFileRef::getRedId, vo.getPlanId());
|
|
|
List<SysFileRef> list = sysFileRefService.list(lw);
|
|
|
- if(!ObjectUtils.isEmpty(list)){
|
|
|
- LambdaQueryWrapper<SysFileInfo> l =new LambdaQueryWrapper();
|
|
|
+ if (!ObjectUtils.isEmpty(list)) {
|
|
|
+ LambdaQueryWrapper<SysFileInfo> l = new LambdaQueryWrapper();
|
|
|
l.in(SysFileInfo::getFileId, list.stream().map(SysFileRef::getFileId).collect(Collectors.toList()));
|
|
|
vo.setFileList(sysFileService.list(l));
|
|
|
}
|
|
|
+ Map<String, Object> stringObjectMap = iSysDeptService.selectDeptById(vo.getPurchaseDeptId());
|
|
|
+ if (!ObjectUtils.isEmpty(stringObjectMap)) {
|
|
|
+ SysDeptResponseVo sysDept = (SysDeptResponseVo) stringObjectMap.get("sysDept");
|
|
|
+ vo.setPurchaseDeptName(sysDept.getDeptName());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return success(vo);
|