商品导入赋默认值

master
erzhongxmu 2024-04-02 11:31:53 +08:00
parent 8a9d0c43be
commit 064aab6993
1 changed files with 16 additions and 12 deletions

View File

@ -213,6 +213,9 @@ public class MdGoodsController extends BaseController {
try { try {
if(StringUtil.isEmpty(mdGoods.getChlKongZhi()) ){ if(StringUtil.isEmpty(mdGoods.getChlKongZhi()) ){
mdGoods.setChlKongZhi("N"); mdGoods.setChlKongZhi("N");
}
if(StringUtil.isEmpty(mdGoods.getChlShl())){
mdGoods.setChlShl("1"); mdGoods.setChlShl("1");
mdGoods.setJshDanWei(mdGoods.getShlDanWei()); mdGoods.setJshDanWei(mdGoods.getShlDanWei());
} }
@ -424,7 +427,19 @@ public class MdGoodsController extends BaseController {
} }
} }
} catch (Exception e) {
e.printStackTrace();
}
try{
if(StringUtil.isEmpty(mdGoods.getChlKongZhi()) ){
mdGoods.setChlKongZhi("N");
}
if(StringUtil.isEmpty(mdGoods.getChlShl())){
mdGoods.setChlShl("1");
mdGoods.setJshDanWei(mdGoods.getShlDanWei());
}
if(StringUtil.isEmpty(mdGoods.getZhlKgm())){ if(StringUtil.isEmpty(mdGoods.getZhlKgm())){
if(!StringUtil.isEmpty(mdGoods.getBzhiQi())){ if(!StringUtil.isEmpty(mdGoods.getBzhiQi())){
int bzhiq = Integer.parseInt(mdGoods.getBzhiQi()); int bzhiq = Integer.parseInt(mdGoods.getBzhiQi());
@ -432,18 +447,7 @@ public class MdGoodsController extends BaseController {
} }
} }
if(StringUtil.isEmpty(mdGoods.getChlKongZhi()) ){ }catch (Exception e){
mdGoods.setChlKongZhi("N");
}
if("N".equals(mdGoods.getChlKongZhi())){
mdGoods.setChlShl("1");
mdGoods.setJshDanWei(mdGoods.getShlDanWei());
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace(); e.printStackTrace();
} }
mdGoodsService.save(mdGoods); mdGoodsService.save(mdGoods);