md
This commit is contained in:
parent
ad76a462b4
commit
c412fb14be
@ -453,6 +453,20 @@ public class EmisBaseService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EmisRegion getRegionByCode(String code){
|
||||||
|
|
||||||
|
EmisRegion queryRegion = new EmisRegion();
|
||||||
|
queryRegion.setRegionCode(code);
|
||||||
|
|
||||||
|
List<EmisRegion> list=emisRegionMapper.selectEmisRegionList(queryRegion);
|
||||||
|
if(!CollectionUtils.isEmpty(list)){
|
||||||
|
return list.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public EmisSite getSiteByCode(String siteCode){
|
public EmisSite getSiteByCode(String siteCode){
|
||||||
EmisSite querySite = new EmisSite();
|
EmisSite querySite = new EmisSite();
|
||||||
|
|||||||
@ -11,24 +11,33 @@
|
|||||||
package com.xdadan.erp.emis.service.impl;
|
package com.xdadan.erp.emis.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.xdadan.erp.emis.domain.EmisDestination;
|
||||||
|
import com.xdadan.erp.emis.domain.EmisRegion;
|
||||||
|
import com.xdadan.erp.emis.mapper.EmisDestinationMapper;
|
||||||
|
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.xdadan.erp.emis.domain.EmisSite;
|
import com.xdadan.erp.emis.domain.EmisSite;
|
||||||
import com.xdadan.erp.emis.mapper.EmisSiteMapper;
|
import com.xdadan.erp.emis.mapper.EmisSiteMapper;
|
||||||
import com.xdadan.erp.emis.service.IEmisSiteService;
|
import com.xdadan.erp.emis.service.IEmisSiteService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网点Service业务层处理
|
* 网点Service业务层处理
|
||||||
*
|
*
|
||||||
* @author linfso
|
* @author linfso
|
||||||
* @date 2023-12-14 13:02:46
|
* @date 2023-12-14 13:02:46
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class EmisSiteServiceImpl implements IEmisSiteService
|
public class EmisSiteServiceImpl extends EmisBaseService implements IEmisSiteService
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmisSiteMapper emisSiteMapper;
|
private EmisSiteMapper emisSiteMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmisDestinationMapper emisDestinationMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询网点
|
* 查询网点
|
||||||
*
|
*
|
||||||
@ -60,9 +69,33 @@ public class EmisSiteServiceImpl implements IEmisSiteService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public int insertEmisSite(EmisSite emisSite)
|
public int insertEmisSite(EmisSite emisSite)
|
||||||
{
|
{
|
||||||
return emisSiteMapper.insertEmisSite(emisSite);
|
|
||||||
|
// 创建网点
|
||||||
|
emisSiteMapper.insertEmisSite(emisSite);
|
||||||
|
|
||||||
|
// 自动创建目的地
|
||||||
|
EmisDestination emisDestination = new EmisDestination();
|
||||||
|
emisDestination.setDestCode(emisSite.getSiteCode());
|
||||||
|
emisDestination.setCountry(emisSite.getCountryCode());
|
||||||
|
emisDestination.setDestName(emisSite.getSiteName());
|
||||||
|
emisDestination.setDestNameEn(emisSite.getSiteNameEn());
|
||||||
|
emisDestination.setStatus(0);
|
||||||
|
emisDestination.setSiteCode(emisSite.getSiteCode());
|
||||||
|
emisDestination.setProvince(emisSite.getProvince());
|
||||||
|
emisDestination.setCity(emisSite.getCity());
|
||||||
|
emisDestination.setCounty(emisSite.getCounty());
|
||||||
|
|
||||||
|
EmisRegion emisRegion=getRegionByCode(emisSite.getProvince());
|
||||||
|
if(emisRegion!=null){
|
||||||
|
emisDestination.setCountryAreaId(emisRegion.getAreaId());
|
||||||
|
}
|
||||||
|
|
||||||
|
emisDestinationMapper.insertEmisDestination(emisDestination);
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user