|
@@ -8,16 +8,22 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.account.entity.cost.dto.CostControlDto;
|
|
|
import com.fjhx.account.entity.cost.dto.CostControlSelectDto;
|
|
|
import com.fjhx.account.entity.cost.po.CostControl;
|
|
|
+import com.fjhx.account.entity.cost.po.CostControlDetail;
|
|
|
import com.fjhx.account.entity.cost.vo.CostControlDetailVo;
|
|
|
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.common.controller.Label;
|
|
|
+import com.fjhx.common.service.logistics.LogisticsCompanyInfoService;
|
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
+import com.ruoyi.system.utils.UserUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -32,6 +38,10 @@ import java.util.List;
|
|
|
*/
|
|
|
@Service
|
|
|
public class CostControlServiceImpl extends ServiceImpl<CostControlMapper, CostControl> implements CostControlService {
|
|
|
+ @Autowired
|
|
|
+ private LogisticsCompanyInfoService logisticsCompanyInfoService;
|
|
|
+ @Autowired
|
|
|
+ private CostControlDetailService costControlDetailService;
|
|
|
|
|
|
@Override
|
|
|
public Page<CostControlVo> getPage(CostControlSelectDto dto) {
|
|
@@ -45,9 +55,30 @@ public class CostControlServiceImpl extends ServiceImpl<CostControlMapper, CostC
|
|
|
public CostControlVo detail(Long id) {
|
|
|
CostControl CostControl = this.getById(id);
|
|
|
CostControlVo result = BeanUtil.toBean(CostControl, CostControlVo.class);
|
|
|
+
|
|
|
+
|
|
|
+ setInfo(Arrays.asList(result));
|
|
|
+
|
|
|
+
|
|
|
+ List<CostControlDetailVo> costControlDetailVos = costControlDetailService.getList(IWrapper.getWrapper().eq(CostControlDetail::getCostControlId, result.getId()));
|
|
|
+ result.setCostControlDetailList(costControlDetailVos);
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ private void setInfo(List<CostControlVo> costControlVos) {
|
|
|
+
|
|
|
+ logisticsCompanyInfoService.attributeAssign(costControlVos, CostControlVo::getLogisticsCompanyId, (detail, logistics) -> {
|
|
|
+ detail.setLogisticsName(logistics.getName());
|
|
|
+ detail.setLogisticsTaxPoints(logistics.getTaxPoints());
|
|
|
+ detail.setLogisticsAccountName(logistics.getAccountName());
|
|
|
+ detail.setLogisticsAccountBank(logistics.getAccountBank());
|
|
|
+ detail.setLogisticsAccountNumber(logistics.getAccountNumber());
|
|
|
+ });
|
|
|
+
|
|
|
+ UserUtil.assignmentNickName(costControlVos, CostControlVo::getApplyUserId, CostControlVo::setApplyUserName);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void add(CostControlDto costControlDto) {
|
|
|
this.save(costControlDto);
|