jiazx0107@163.com
2023-05-29 0efbf246a22f7331cf2e16bd659caea22a494102
igds-core/src/main/java/com/ld/igds/view/service/HDepotService.java
@@ -97,6 +97,8 @@
            Map<String, Object> args = new HashMap<>();
            args.put("companyId", companyId);
            list = this.getData(args);
            coreCommonService.setCacheDepot(list, companyId);
        } catch (Exception e) {
            e.printStackTrace();
@@ -147,7 +149,7 @@
     *
     * @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());
@@ -253,15 +255,6 @@
        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";
@@ -306,27 +299,6 @@
        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();
        }
    }
}