|
|
|
@ -7,12 +7,15 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesCustomerOriganze;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesCustomerCarModelRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesCustomerRepository;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author yinxiao
|
|
|
|
|
* @date 2023-2023/6/2 10:54
|
|
|
|
@ -24,6 +27,8 @@ public class MesCustomerOriganzeService extends BaseMesService<MesCustomerOrigan
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesCustomerCarModelRepository mesCustomerCarModelRDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesCustomerRepository customerRepository;
|
|
|
|
|
|
|
|
|
|
protected void onInsertBean(MesCustomerOriganze item) {
|
|
|
|
|
// 数据校验
|
|
|
|
@ -76,7 +81,7 @@ public class MesCustomerOriganzeService extends BaseMesService<MesCustomerOrigan
|
|
|
|
|
//校验客户车型配置
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesCustomerOriganze.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(mesCustomerOriganze.getCustOrganizeCode(), "customerOrganizeCode", packBean);
|
|
|
|
|
if(mesCustomerCarModelRDao.isExitByHql(packBean)){
|
|
|
|
|
if (mesCustomerCarModelRDao.isExitByHql(packBean)) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
@ -84,4 +89,23 @@ public class MesCustomerOriganzeService extends BaseMesService<MesCustomerOrigan
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 校验导入数据
|
|
|
|
|
@Override
|
|
|
|
|
public void validateImport(List<MesCustomerOriganze> beanList) {
|
|
|
|
|
|
|
|
|
|
for (MesCustomerOriganze bean : beanList) {
|
|
|
|
|
|
|
|
|
|
//todo
|
|
|
|
|
//查询数据库校验字段,待确定
|
|
|
|
|
// DdlPackBean packBean = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
|
|
|
|
|
// DdlPreparedPack.getStringEqualPack(bean.getCustCode(), "custCode", packBean);
|
|
|
|
|
// MesCustomer customer = customerRepository.getByProperty(packBean);
|
|
|
|
|
// if (StringUtils.isEmpty(customer)) {
|
|
|
|
|
// throw new ImppBusiException(String.format("客户代码【%s】不存在", bean.getCustCode()));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// bean.setCustName(customer.getCustName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|