|
@ -282,10 +282,6 @@ public class BaseGoodsSpuService extends MybatisBaseService<BaseGoodsSpuMapper, |
|
|
public ResultBean<String> saveOrUpdateGoods(BaseGoodsDetailsDto dto) { |
|
|
public ResultBean<String> saveOrUpdateGoods(BaseGoodsDetailsDto dto) { |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
String sid = ""; |
|
|
String sid = ""; |
|
|
String orgPath = ""; |
|
|
|
|
|
if (StringUtils.isNotBlank(dto.getOrgPath())) { |
|
|
|
|
|
orgPath = dto.getOrgPath(); |
|
|
|
|
|
} |
|
|
|
|
|
BaseGoodsSpu spun = baseMapper.selectOne(new QueryWrapper<BaseGoodsSpu>().eq("sid", dto.getSid())); |
|
|
BaseGoodsSpu spun = baseMapper.selectOne(new QueryWrapper<BaseGoodsSpu>().eq("sid", dto.getSid())); |
|
|
if (spun != null) { |
|
|
if (spun != null) { |
|
|
sid = dto.getSid(); |
|
|
sid = dto.getSid(); |
|
@ -415,34 +411,10 @@ public class BaseGoodsSpuService extends MybatisBaseService<BaseGoodsSpuMapper, |
|
|
sid = wmsGoods.getSid(); |
|
|
sid = wmsGoods.getSid(); |
|
|
BeanUtil.copyProperties(dto, wmsGoods, "id", "sid"); |
|
|
BeanUtil.copyProperties(dto, wmsGoods, "id", "sid"); |
|
|
wmsGoods.setCreateBySid(dto.getUserSid()); |
|
|
wmsGoods.setCreateBySid(dto.getUserSid()); |
|
|
String deptName = ""; |
|
|
wmsGoods.setUseOrgSid(dto.getUseOrgSid()); |
|
|
String deptSid = ""; |
|
|
wmsGoods.setCreateOrgSid(dto.getCreateOrgSid()); |
|
|
String createOrgSid = ""; |
|
|
|
|
|
if (StringUtils.isNotBlank(orgPath)) { |
|
|
|
|
|
List<String> split = Arrays.asList(orgPath.split("/")); |
|
|
|
|
|
if (split.size() > 1) { |
|
|
|
|
|
//获取本级sid获取本级部门信息
|
|
|
|
|
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(split.size() - 2)).getData(); |
|
|
|
|
|
SysOrganizationVo sysOrganization1 = sysOrganizationFeign.fetchBySid(split.get(split.size() - 1)).getData(); |
|
|
|
|
|
deptName = sysOrganization.getName() + "/" + sysOrganization1.getName(); |
|
|
|
|
|
deptName = sysOrganization1.getName(); |
|
|
|
|
|
deptSid = sysOrganization1.getSid(); |
|
|
|
|
|
} else { |
|
|
|
|
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(0)).getData(); |
|
|
|
|
|
deptName = sysOrganization.getName(); |
|
|
|
|
|
deptName = sysOrganization.getName(); |
|
|
|
|
|
deptSid = sysOrganization.getSid(); |
|
|
|
|
|
} |
|
|
|
|
|
wmsGoods.setUseOrgSid(deptSid); |
|
|
|
|
|
createOrgSid = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); |
|
|
|
|
|
//创建组织使用组织
|
|
|
|
|
|
ResultBean<SysOrganizationVo> organizationResultBean = sysOrganizationFeign.fetchBySid(createOrgSid); |
|
|
|
|
|
if (organizationResultBean.getData() != null) { |
|
|
|
|
|
wmsGoods.setCreateOrgSid(createOrgSid); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
wmsGoods.setGoodsPY(PinYinUtils.sx(wmsGoods.getGoodsName())); |
|
|
wmsGoods.setGoodsPY(PinYinUtils.sx(wmsGoods.getGoodsName())); |
|
|
BaseGoodsSpu spu = baseMapper.checkForInsert(dto.getGoodsCode(), deptSid); |
|
|
BaseGoodsSpu spu = baseMapper.checkForInsert(dto.getGoodsCode(), dto.getUseOrgSid()); |
|
|
if (spu != null) { |
|
|
if (spu != null) { |
|
|
return rb.setMsg("商品编码重复"); |
|
|
return rb.setMsg("商品编码重复"); |
|
|
} |
|
|
} |
|
|