|
|
@ -95,11 +95,11 @@ public class FixedCarrierController extends AbstractController { |
|
|
public R save(@RequestBody FixedCarrier fixedCarrier) { |
|
|
public R save(@RequestBody FixedCarrier fixedCarrier) { |
|
|
try { |
|
|
try { |
|
|
// 参数校验 |
|
|
// 参数校验 |
|
|
if (fixedCarrier.getSite() == null || fixedCarrier.getSite().isEmpty()) { |
|
|
|
|
|
return R.error("站点不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (fixedCarrier.getBuNo() == null || fixedCarrier.getBuNo().isEmpty()) { |
|
|
|
|
|
return R.error("BU不能为空"); |
|
|
|
|
|
|
|
|
if (fixedCarrier.getBu().split("_").length >= 2 ) { |
|
|
|
|
|
fixedCarrier.setSite(fixedCarrier.getBu().split("_")[0]); |
|
|
|
|
|
fixedCarrier.setBuNo(fixedCarrier.getBu().split("_")[1]); |
|
|
|
|
|
} else { |
|
|
|
|
|
return R.error("工厂和部门有误!"); |
|
|
} |
|
|
} |
|
|
if (fixedCarrier.getCarrierNo() == null || fixedCarrier.getCarrierNo().isEmpty()) { |
|
|
if (fixedCarrier.getCarrierNo() == null || fixedCarrier.getCarrierNo().isEmpty()) { |
|
|
return R.error("载具编码不能为空"); |
|
|
return R.error("载具编码不能为空"); |
|
|
@ -137,11 +137,11 @@ public class FixedCarrierController extends AbstractController { |
|
|
public R update(@RequestBody FixedCarrier fixedCarrier) { |
|
|
public R update(@RequestBody FixedCarrier fixedCarrier) { |
|
|
try { |
|
|
try { |
|
|
// 参数校验 |
|
|
// 参数校验 |
|
|
if (fixedCarrier.getSite() == null || fixedCarrier.getSite().isEmpty()) { |
|
|
|
|
|
return R.error("站点不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (fixedCarrier.getBuNo() == null || fixedCarrier.getBuNo().isEmpty()) { |
|
|
|
|
|
return R.error("BU不能为空"); |
|
|
|
|
|
|
|
|
if (fixedCarrier.getBu().split("_").length >= 2 ) { |
|
|
|
|
|
fixedCarrier.setSite(fixedCarrier.getBu().split("_")[0]); |
|
|
|
|
|
fixedCarrier.setBuNo(fixedCarrier.getBu().split("_")[1]); |
|
|
|
|
|
} else { |
|
|
|
|
|
return R.error("工厂和部门有误!"); |
|
|
} |
|
|
} |
|
|
if (fixedCarrier.getCarrierNo() == null || fixedCarrier.getCarrierNo().isEmpty()) { |
|
|
if (fixedCarrier.getCarrierNo() == null || fixedCarrier.getCarrierNo().isEmpty()) { |
|
|
return R.error("载具编码不能为空"); |
|
|
return R.error("载具编码不能为空"); |
|
|
|