| | |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改 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; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | 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+"失败"); |
| | | } |
| | | } |
| | | } |
| | | } |