|
@@ -16,6 +16,7 @@ import com.fjhx.account.entity.cost.vo.CostControlVo;
|
|
|
import com.fjhx.account.mapper.cost.CostControlMapper;
|
|
|
import com.fjhx.account.service.cost.CostControlDetailService;
|
|
|
import com.fjhx.account.service.cost.CostControlService;
|
|
|
+import com.fjhx.account.service.payment.PaymentTypeService;
|
|
|
import com.fjhx.common.controller.Label;
|
|
|
import com.fjhx.common.enums.FlowStatusEnum1;
|
|
|
import com.fjhx.common.service.logistics.LogisticsCompanyInfoService;
|
|
@@ -25,8 +26,10 @@ import com.fjhx.flow.enums.FlowStatusEnum;
|
|
|
import com.fjhx.flow.service.flow.FlowExampleService;
|
|
|
import com.ruoyi.common.core.domain.BaseIdPo;
|
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
|
+import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
+import com.ruoyi.system.service.ISysDeptService;
|
|
|
import com.ruoyi.system.utils.UserUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -52,12 +55,22 @@ public class CostControlServiceImpl extends ServiceImpl<CostControlMapper, CostC
|
|
|
private CostControlDetailService costControlDetailService;
|
|
|
@Autowired
|
|
|
private FlowExampleService flowExampleService;
|
|
|
+ @Autowired
|
|
|
+ private ISysDeptService sysDeptService;
|
|
|
+ @Autowired
|
|
|
+ private PaymentTypeService paymentTypeService;
|
|
|
|
|
|
@Override
|
|
|
public Page<CostControlVo> getPage(CostControlSelectDto dto) {
|
|
|
IWrapper<CostControl> wrapper = getWrapper();
|
|
|
wrapper.orderByDesc("cc", CostControl::getId);
|
|
|
Page<CostControlVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
+ List<CostControlVo> records = page.getRecords();
|
|
|
+ if (ObjectUtil.isEmpty(records)) {
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ setInfo(records);
|
|
|
return page;
|
|
|
}
|
|
|
|
|
@@ -77,6 +90,10 @@ public class CostControlServiceImpl extends ServiceImpl<CostControlMapper, CostC
|
|
|
}
|
|
|
|
|
|
private void setInfo(List<CostControlVo> costControlVos) {
|
|
|
+
|
|
|
+ paymentTypeService.attributeAssign(costControlVos, CostControlVo::getCostType, (detail, paymentType) -> {
|
|
|
+ detail.setCostTypeName(paymentType.getName());
|
|
|
+ });
|
|
|
|
|
|
logisticsCompanyInfoService.attributeAssign(costControlVos, CostControlVo::getLogisticsCompanyId, (detail, logistics) -> {
|
|
|
detail.setLogisticsName(logistics.getName());
|
|
@@ -87,6 +104,17 @@ public class CostControlServiceImpl extends ServiceImpl<CostControlMapper, CostC
|
|
|
});
|
|
|
|
|
|
UserUtil.assignmentNickName(costControlVos, CostControlVo::getApplyUserId, CostControlVo::setApplyUserName);
|
|
|
+
|
|
|
+ List<SysDept> deptList = sysDeptService.list();
|
|
|
+ Map<Long, String> deptMap = new HashMap<>();
|
|
|
+ if (ObjectUtil.isNotEmpty(deptList)) {
|
|
|
+ deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
|
|
|
+ }
|
|
|
+ for (CostControlVo costControlVo : costControlVos) {
|
|
|
+
|
|
|
+ costControlVo.setCompanyName(deptMap.get(costControlVo.getCompanyId()));
|
|
|
+ costControlVo.setDeptName(deptMap.get(costControlVo.getDeptId()));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|