供应商/客户-评价

This commit is contained in:
2025-12-19 17:44:49 +08:00
parent 52af6011df
commit 4b1a419c23
10 changed files with 98 additions and 28 deletions

View File

@ -34,7 +34,7 @@ public class LngScorePageVo {
* 评价体系主键
*/
@ApiModelProperty("评价体系主键")
@Trans(type = TransType.API, id = "93d735dcb7364a0f8102188ec4d77ac7")
//@Trans(type = TransType.API, id = "93d735dcb7364a0f8102188ec4d77ac7")
private String gsId;
/**
* 供应商/客户

View File

@ -4,6 +4,8 @@ import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import com.xjrsoft.common.annotation.Trans;
import com.xjrsoft.common.enums.TransType;
import com.xjrsoft.module.supplier.vo.LngScoreDtlVo;
import com.xjrsoft.module.system.vo.LngFileUploadVo;
@ -135,4 +137,16 @@ public class LngScoreVo {
@ApiModelProperty("lngFileUpload子表")
private List<LngFileUploadVo> lngFileUploadList;
@Trans(type = TransType.DIC, id = "1990668094164484097", transToFieldName = "cpClassName")
private String cpClassCode;
private String cpClassName;
/**
* 供应商/客户
*/
@ApiModelProperty("供应商/客户名称")
private String cpName;
}

View File

@ -4,6 +4,8 @@ import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import com.xjrsoft.common.annotation.Trans;
import com.xjrsoft.common.enums.TransType;
import com.xjrsoft.module.system.vo.LngFileUploadVo;
import io.swagger.annotations.ApiModelProperty;
@ -137,4 +139,17 @@ public class LngScoreVo {
@ApiModelProperty("lngFileUpload子表")
private List<LngFileUploadVo> lngFileUploadList;
@Trans(type = TransType.DIC, id = "1990668094164484097", transToFieldName = "cpClassName")
private String cpClassCode;
private String cpClassName;
/**
* 供应商/客户
*/
@ApiModelProperty("供应商/客户名称")
private String cpName;
}

View File

@ -1,17 +1,13 @@
package com.xjrsoft.module.mdm.service.impl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.xjrsoft.module.mdm.entity.LngBPlaceLngUnload;
import com.xjrsoft.module.mdm.mapper.LngBPlaceLngUnloadMapper;
import com.xjrsoft.module.mdm.service.IPlaceLngUnloadService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
/**
* @title: service

View File

@ -119,7 +119,18 @@ public class CustomerScoreController {
@SaCheckPermission("scoreCustomer:edit")
public R update(@Valid @RequestBody UpdateLngScoreDto dto){
return R.ok(dataService.updateById(dto));
return R.ok(dataService.updateById(dto, new DataOperationListener<UpdateLngScoreDto>() {
@Override
public UpdateLngScoreDto before(DataOperationContent<UpdateLngScoreDto> content) {
return null;
}
@Override
public UpdateLngScoreDto after(DataOperationContent<UpdateLngScoreDto> content) {
//execAfter(content.getTableName(), content.getIdValue(), "I");
return content.getObj();
}
}));
}
@DeleteMapping

View File

@ -1,28 +1,25 @@
package com.xjrsoft.module.sales.service.impl;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.xjrsoft.module.sales.entity.LngCustomer;
import com.xjrsoft.module.sales.entity.LngScore;
import com.xjrsoft.module.sales.entity.LngScoreDtl;
import com.xjrsoft.module.sales.mapper.LngCustomerMapper;
import com.xjrsoft.module.sales.mapper.LngCustomerScoreDtlMapper;
import com.xjrsoft.module.sales.mapper.LngCustomerScoreMapper;
import com.xjrsoft.module.sales.service.IScoreCustomerService;
import com.xjrsoft.module.sales.vo.LngCustomerDocVo;
import com.xjrsoft.module.sales.vo.LngCustomerVo;
import com.xjrsoft.module.sales.vo.LngScoreVo;
import com.xjrsoft.module.system.client.IFileClient;
import com.xjrsoft.module.system.vo.LngFileUploadVo;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import lombok.AllArgsConstructor;
/**
@ -34,9 +31,12 @@ import lombok.AllArgsConstructor;
@Service
@AllArgsConstructor
public class CustomerScoreServiceImpl extends MPJBaseServiceImpl<LngCustomerScoreMapper, LngScore> implements IScoreCustomerService {
private final LngCustomerScoreMapper scoreCustomerLngScoreMapper;
private final LngCustomerScoreMapper customerScoreMapper;
private final LngCustomerScoreDtlMapper customerScoreDtlMapper;
private final LngCustomerMapper customerMapper;
private final LngCustomerScoreDtlMapper scoreCustomerLngScoreDtlMapper;
private final IFileClient fileClient;
@ -44,8 +44,8 @@ public class CustomerScoreServiceImpl extends MPJBaseServiceImpl<LngCustomerScor
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean delete(List<Long> ids) {
scoreCustomerLngScoreMapper.deleteBatchIds(ids);
scoreCustomerLngScoreDtlMapper.delete(Wrappers.lambdaQuery(LngScoreDtl.class).in(LngScoreDtl::getSId, ids));
customerScoreMapper.deleteBatchIds(ids);
customerScoreDtlMapper.delete(Wrappers.lambdaQuery(LngScoreDtl.class).in(LngScoreDtl::getSId, ids));
return true;
}
@ -57,6 +57,13 @@ public class CustomerScoreServiceImpl extends MPJBaseServiceImpl<LngCustomerScor
return null;
}
LngScoreVo vo = BeanUtil.toBean(lngScore, LngScoreVo.class);
LngCustomer customer = customerMapper.selectOne(new LambdaQueryWrapper<LngCustomer>()
.eq(LngCustomer::getCuCode, vo.getCpCode()));
if(customer != null) {
vo.setCpClassCode(customer.getClassCode());
vo.setCpName(customer.getCuName());
}
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_score", "lngFileUploadList", vo.getId());
vo.setLngFileUploadList(fileList);
return vo;

View File

@ -28,10 +28,8 @@ import com.xjrsoft.module.supplier.dto.UpdateLngScoreDto;
import com.xjrsoft.module.supplier.entity.LngScore;
import com.xjrsoft.module.supplier.service.IScoreSupplierService;
import com.xjrsoft.module.supplier.vo.LngScorePageVo;
import com.xjrsoft.module.supplier.vo.LngScoreVo;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
@ -115,7 +113,17 @@ public class SupplierScoreController {
@ApiOperation(value = "修改LngScore")
@SaCheckPermission("scoreSupplier:edit")
public R update(@Valid @RequestBody UpdateLngScoreDto dto){
return R.ok(dataService.updateById(dto));
return R.ok(dataService.updateById(dto, new DataOperationListener<UpdateLngScoreDto>() {
@Override
public UpdateLngScoreDto before(DataOperationContent<UpdateLngScoreDto> content) {
return null;
}
@Override
public UpdateLngScoreDto after(DataOperationContent<UpdateLngScoreDto> content) {
return content.getObj();
}
}));
}
@DeleteMapping

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.github.yulichang.base.MPJBaseService;
import com.github.yulichang.extension.mapping.base.MPJDeepService;
import com.github.yulichang.extension.mapping.base.MPJRelationService;
import com.xjrsoft.module.supplier.dto.UpdateLngSupplierDto;
import com.xjrsoft.module.supplier.entity.LngSupplier;
import com.xjrsoft.module.supplier.vo.LngSupplierVo;
@ -29,4 +30,5 @@ public interface ISupplierService extends MPJBaseService<LngSupplier>, MPJDeepSe
Boolean delete(List<Long> ids);
LngSupplierVo getSupplierById(Long id);
}

View File

@ -3,7 +3,11 @@ package com.xjrsoft.module.supplier.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.xjrsoft.module.supplier.entity.LngScoreDtl;
import com.xjrsoft.module.supplier.entity.LngSupplier;
import com.xjrsoft.module.supplier.mapper.LngSupplierMapper;
import com.xjrsoft.module.supplier.mapper.LngSupplierScoreDtlMapper;
import com.xjrsoft.module.mdm.entity.LngBRegion;
import com.xjrsoft.module.supplier.dto.UpdateLngSupplierDto;
import com.xjrsoft.module.supplier.entity.LngScore;
import com.xjrsoft.module.supplier.mapper.LngSupplierScoreMapper;
import com.xjrsoft.module.supplier.service.IScoreSupplierService;
@ -18,6 +22,8 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
/**
@ -30,9 +36,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@AllArgsConstructor
public class SupplierScoreServiceImpl extends MPJBaseServiceImpl<LngSupplierScoreMapper, LngScore> implements IScoreSupplierService {
private final LngSupplierScoreMapper scoreSupplierLngScoreMapper;
private final LngSupplierScoreMapper supplierScoreMapper;
private final LngSupplierScoreDtlMapper scoreSupplierLngScoreDtlMapper;
private final LngSupplierScoreDtlMapper supplierScoreDtlMapper;
private final LngSupplierMapper supplierMapper;
private final IFileClient fileClient;
@ -40,8 +48,8 @@ public class SupplierScoreServiceImpl extends MPJBaseServiceImpl<LngSupplierScor
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean delete(List<Long> ids) {
scoreSupplierLngScoreMapper.deleteBatchIds(ids);
scoreSupplierLngScoreDtlMapper.delete(Wrappers.lambdaQuery(LngScoreDtl.class).in(LngScoreDtl::getSId, ids));
supplierScoreMapper.deleteBatchIds(ids);
supplierScoreDtlMapper.delete(Wrappers.lambdaQuery(LngScoreDtl.class).in(LngScoreDtl::getSId, ids));
return true;
}
@ -54,6 +62,13 @@ public class SupplierScoreServiceImpl extends MPJBaseServiceImpl<LngSupplierScor
return null;
}
LngScoreVo vo = BeanUtil.toBean(lngScore, LngScoreVo.class);
LngSupplier supplier = supplierMapper.selectOne(new LambdaQueryWrapper<LngSupplier>()
.eq(LngSupplier::getSuCode, vo.getCpCode()));
if(supplier != null) {
vo.setCpClassCode(supplier.getClassCode());
vo.setCpName(supplier.getSuName());
}
List<LngFileUploadVo> fileList = fileClient.getTableFiles("lng_score", "lngFileUploadList", vo.getId());
vo.setLngFileUploadList(fileList);
return vo;

View File

@ -7,6 +7,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.xjrsoft.module.supplier.dto.UpdateLngSupplierDto;
import com.xjrsoft.module.supplier.entity.LngSupplier;
import com.xjrsoft.module.supplier.entity.LngSupplierBank;
import com.xjrsoft.module.supplier.entity.LngSupplierContact;
@ -34,7 +35,7 @@ import lombok.AllArgsConstructor;
@Service
@AllArgsConstructor
public class SupplierServiceImpl extends MPJBaseServiceImpl<LngSupplierMapper, LngSupplier> implements ISupplierService {
private final LngSupplierMapper supplierLngSupplierMapper;
private final LngSupplierMapper supplierMapper;
private final LngSupplierBankMapper supplierLngSupplierBankMapper;
private final LngSupplierContactMapper supplierLngSupplierContactMapper;
@ -45,7 +46,7 @@ public class SupplierServiceImpl extends MPJBaseServiceImpl<LngSupplierMapper, L
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean delete(List<Long> ids) {
supplierLngSupplierMapper.deleteBatchIds(ids);
supplierMapper.deleteBatchIds(ids);
supplierLngSupplierBankMapper.delete(Wrappers.lambdaQuery(LngSupplierBank.class).in(LngSupplierBank::getSuCode, ids));
supplierLngSupplierContactMapper.delete(Wrappers.lambdaQuery(LngSupplierContact.class).in(LngSupplierContact::getSuCode, ids));
supplierLngSupplierDocMapper.delete(Wrappers.lambdaQuery(LngSupplierDoc.class).in(LngSupplierDoc::getSuCode, ids));
@ -72,4 +73,5 @@ public class SupplierServiceImpl extends MPJBaseServiceImpl<LngSupplierMapper, L
}
}