| | |
| | | Map<String, Object> args = new HashMap<>(); |
| | | args.put("companyId", companyId); |
| | | list = this.getData(args); |
| | | |
| | | |
| | | coreCommonService.setCacheDepot(list, companyId); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | * |
| | | * @throws Exception |
| | | */ |
| | | public void updataDepot(Depot depot) throws Exception { |
| | | public void updateDepot(Depot depot) throws Exception { |
| | | Session session = this.getSessionFactory().openSession(); |
| | | try { |
| | | flushCache(depot.getCompanyId()); |
| | |
| | | coreCommonService.setCacheDepotConf(list, companyId); |
| | | } |
| | | |
| | | // public void initInoutRecord(InoutRecord inoutRecord) { |
| | | // Session session = this.getSessionFactory().openSession(); |
| | | // try { |
| | | // session.saveOrUpdate(inoutRecord); |
| | | // } finally { |
| | | // session.flush(); |
| | | // session.close(); |
| | | // } |
| | | // } |
| | | |
| | | public void updateFreq(String freq) { |
| | | String sql = "UPDATE D_DEPOT_CONF SET GRAIN_FREQ_ =:freq WHERE COMPANY_ID_ =:companyId"; |
| | |
| | | if (null == list || list.isEmpty()) return; |
| | | for (Depot depot : list) { |
| | | ContextUtil.updateSubDept(depot.getId(), depot.getDeptId()); |
| | | } |
| | | } |
| | | |
| | | public void updateByStore(DepotStore depotStore) { |
| | | String sql = "UPDATE D_DEPOT SET STORAGE_REAL_ =:storageReal,DEPOT_STATUS_=:depotStatus "; |
| | | Session session = this.getSessionFactory().openSession(); |
| | | String companyId = depotStore.getCompanyId(); |
| | | if (null == companyId) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | try { |
| | | sql += " WHERE COMPANY_ID_ =:companyId AND ID_=:id"; |
| | | SQLQuery query = session.createSQLQuery(sql); |
| | | query.setDouble("storageReal", depotStore.getStorageReal()); |
| | | query.setString("depotStatus", depotStore.getDepotStatus()); |
| | | query.setString("companyId", companyId); |
| | | query.setString("id", depotStore.getDepotId()); |
| | | query.executeUpdate(); |
| | | } finally { |
| | | session.flush(); |
| | | session.close(); |
| | | } |
| | | } |
| | | } |