|
|
@ -14,7 +14,9 @@ import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
|
import com.yxt.common.base.utils.StringUtils; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
@ -31,6 +33,8 @@ public class AsServiceItemService extends MybatisBaseService<AsServiceItemMapper |
|
|
|
private WmsManufacturerFeign wmsManufacturerFeign; |
|
|
|
@Resource |
|
|
|
private BaseVehicleModelFeign baseVehicleModelFeign; |
|
|
|
@Autowired |
|
|
|
private SysStaffOrgFeign sysStaffOrgFeign; |
|
|
|
|
|
|
|
private QueryWrapper<AsServiceItem> createQueryWrapper(AsServiceItemQuery query) { |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
@ -45,7 +49,10 @@ public class AsServiceItemService extends MybatisBaseService<AsServiceItemMapper |
|
|
|
if (StringUtils.isNotBlank(query.getManufacturer())) { |
|
|
|
qw.eq("manufacturer", query.getManufacturer()); |
|
|
|
} |
|
|
|
qw.eq("useOrgSid", query.getUseOrgSid()); |
|
|
|
ResultBean<String> orgSidByPath = sysStaffOrgFeign.getOrgSidByPath(query.getOrgPath()); |
|
|
|
if (orgSidByPath.getSuccess()) { |
|
|
|
qw.eq("useOrgSid", orgSidByPath.getData()); |
|
|
|
} |
|
|
|
qw.orderByAsc("sortNo"); |
|
|
|
return qw; |
|
|
|
} |
|
|
@ -76,12 +83,24 @@ public class AsServiceItemService extends MybatisBaseService<AsServiceItemMapper |
|
|
|
} else { |
|
|
|
AsServiceItem item = new AsServiceItem(); |
|
|
|
BeanUtil.copyProperties(dto, item, "id", "sid"); |
|
|
|
String orgPath = dto.getOrgPath(); |
|
|
|
ResultBean<String> orgSidByPath = sysStaffOrgFeign.getOrgSidByPath(orgPath); |
|
|
|
if (orgSidByPath.getSuccess()) { |
|
|
|
String useOrgSid = orgSidByPath.getData(); |
|
|
|
item.setUseOrgSid(useOrgSid); |
|
|
|
item.setCreateOrgSid(useOrgSid); |
|
|
|
} |
|
|
|
baseMapper.insert(item); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public List<ManufacturerVo> getManufacturers(String useOrgSid) { |
|
|
|
public List<ManufacturerVo> getManufacturers(String orgPath) { |
|
|
|
List<ManufacturerVo> voList = new ArrayList<>(); |
|
|
|
String useOrgSid = ""; |
|
|
|
ResultBean<String> orgSidByPath = sysStaffOrgFeign.getOrgSidByPath(orgPath); |
|
|
|
if (orgSidByPath.getSuccess()) { |
|
|
|
useOrgSid = orgSidByPath.getData(); |
|
|
|
} |
|
|
|
List<WmsManufacturerVo> wmsManufacturerVos = wmsManufacturerFeign.getAllTypeByUseOrgSid(useOrgSid).getData(); |
|
|
|
if (!wmsManufacturerVos.isEmpty()) { |
|
|
|
for (WmsManufacturerVo wmsManufacturerVo : wmsManufacturerVos) { |
|
|
@ -94,8 +113,13 @@ public class AsServiceItemService extends MybatisBaseService<AsServiceItemMapper |
|
|
|
return voList; |
|
|
|
} |
|
|
|
|
|
|
|
public List<VehModelVo> getVehModel(String useOrgSid) { |
|
|
|
public List<VehModelVo> getVehModel(String orgPath) { |
|
|
|
List<VehModelVo> voList = new ArrayList<>(); |
|
|
|
String useOrgSid = ""; |
|
|
|
ResultBean<String> orgSidByPath = sysStaffOrgFeign.getOrgSidByPath(orgPath); |
|
|
|
if (orgSidByPath.getSuccess()) { |
|
|
|
useOrgSid = orgSidByPath.getData(); |
|
|
|
} |
|
|
|
List<BaseVehModelVo> baseVehModelVos = baseVehicleModelFeign.getVehModelByCreateOrg(useOrgSid).getData(); |
|
|
|
if (!baseVehModelVos.isEmpty()) { |
|
|
|
for (BaseVehModelVo baseVehModelVo : baseVehModelVos) { |
|
|
@ -107,4 +131,14 @@ public class AsServiceItemService extends MybatisBaseService<AsServiceItemMapper |
|
|
|
} |
|
|
|
return voList; |
|
|
|
} |
|
|
|
|
|
|
|
public List<ServiceTypeVo> getServiceType(String orgPath) { |
|
|
|
String useOrgSid = ""; |
|
|
|
ResultBean<String> orgSidByPath = sysStaffOrgFeign.getOrgSidByPath(orgPath); |
|
|
|
if (orgSidByPath.getSuccess()) { |
|
|
|
useOrgSid = orgSidByPath.getData(); |
|
|
|
} |
|
|
|
List<ServiceTypeVo> voList = baseMapper.getServiceType(useOrgSid); |
|
|
|
return voList; |
|
|
|
} |
|
|
|
} |
|
|
|