自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-12-08 8b2fbb38c76c670c1db5e4d2ac3d874503cbe5e2
#
2个文件已修改
18 ■■■■■ 已修改文件
src/main/java/com/zy/common/service/erp/ErpService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/erp/task/ErpScheduler.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/erp/ErpService.java
@@ -10,6 +10,7 @@
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@@ -72,4 +73,14 @@
    }
    /**
     * 修改 Goods 表 state
     */
    public boolean updateStateForGoods(String barcode, Integer state){
        String sql = "update Goods set State = ''{1}' where BarCode = ''{0}''";
        sql = MessageFormat.format(sql, barcode, state);
        return erpSqlServer.update(sql) > 0;
    }
}
src/main/java/com/zy/common/service/erp/task/ErpScheduler.java
@@ -65,7 +65,12 @@
                    }
                    if (!matService.insert(mat)) {
                        throw new CoolException(JSON.toJSONString(good) + "商品同步失败");
                        throw new CoolException(good.getBarCode() + "商品同步失败");
                    } else {
                        int state = 1;
                        if (!erpService.updateStateForGoods(good.getBarCode(), state)) {
                            throw new CoolException(good.getBarCode() + "商品修改State为"+state+"失败");
                        }
                    }
                }
            }