| | |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | 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); |
| | | String sql = "update Goods set State = ''{1}'', LastUpdatedDate = ''{{2}}'' where BarCode = ''{0}''"; |
| | | sql = MessageFormat.format(sql, barcode, state, new Date()); |
| | | return erpSqlServer.update(sql) > 0; |
| | | } |
| | | |
| | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | @Synchronized |
| | | @Transactional |
| | | public synchronized void syncMat1() { |
| | | erpService.updateStateForGoods("PL0122231401176", 1); |
| | | } |
| | | |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | @Synchronized |
| | | @Transactional |