Преглед на файлове

解决bug,个人修改关联企业相关

XMTT преди 6 години
родител
ревизия
86b6bc310f

+ 1 - 1
src/main/java/com/ekexiu/portal/dao/DemandDao.java

109

109

110
	@PageSelect
110
	@PageSelect
111
	@OrderBy(" ORDER BY STATE ASC,CREATE_TIME DESC")
111
	@OrderBy(" ORDER BY STATE ASC,CREATE_TIME DESC")
112
	public abstract PageQueryResult<Demand> pageQueryOrg(Connection con,@Nullable @In String[] state,@GroupSqlColumn(value={"ORG_NAME = ?","CREATOR IN (SELECT ID FROM PROFESSOR WHERE ORG_ID IN(SELECT ID FROM ORGANIZATION WHERE NAME = ?) AND ORG_AUTH = '1')"},handlerClass = StringHandler.class,isAnd = false,force = false) String orgName,int pageSize,int pageNo) throws SQLException;
112
	public abstract PageQueryResult<Demand> pageQueryOrg(Connection con,@Nullable @In String[] state,@GroupSqlColumn(value={"ORG_NAME = ?","CREATOR IN (SELECT ID FROM PROFESSOR WHERE ORG_AUTH = '1')"},handlerClass = StringHandler.class,force = false) String orgName,int pageSize,int pageNo) throws SQLException;
113

113

114
	@PageSelect
114
	@PageSelect
115
	@OrderBy(" ORDER BY CREATE_TIME DESC")
115
	@OrderBy(" ORDER BY CREATE_TIME DESC")

+ 1 - 1
src/main/java/com/ekexiu/portal/po/Demand.java

162
	 * 发布人ID
162
	 * 发布人ID
163
	 * @return
163
	 * @return
164
	 */
164
	 */
165
	@Column(handlerClass=FixLenStringHandler.class,dbType="CHAR(32)",insertable=true,nullable=false,queryable=true,renewable=false)	
165
	@Column(handlerClass=FixLenStringHandler.class,dbType="CHAR(32)",insertable=true,nullable=false,queryable=true,renewable=true)
166
	public String getCreator() {
166
	public String getCreator() {
167
		return creator;
167
		return creator;
168
	}
168
	}

+ 9 - 0
src/main/java/com/ekexiu/portal/product/ProductDao.java

4
import org.jfw.apt.annotation.Nullable;
4
import org.jfw.apt.annotation.Nullable;
5
import org.jfw.apt.orm.annotation.dao.Column;
5
import org.jfw.apt.orm.annotation.dao.Column;
6
import org.jfw.apt.orm.annotation.dao.DAO;
6
import org.jfw.apt.orm.annotation.dao.DAO;
7
import org.jfw.apt.orm.annotation.dao.method.Exclude;
7
import org.jfw.apt.orm.annotation.dao.method.From;
8
import org.jfw.apt.orm.annotation.dao.method.From;
8
import org.jfw.apt.orm.annotation.dao.method.LimitColumn;
9
import org.jfw.apt.orm.annotation.dao.method.LimitColumn;
9
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
10
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
48
    @From(ProductPro.class)
49
    @From(ProductPro.class)
49
    int deleteProductPro(Connection con, String id) throws SQLException;
50
    int deleteProductPro(Connection con, String id) throws SQLException;
50
51
52
    @DeleteWith
53
    @From(ProductPro.class)
54
    int deletePro(Connection con, String professor) throws SQLException;
55
51
    @DeleteWith
56
    @DeleteWith
52
    @From(ProductPro.class)
57
    @From(ProductPro.class)
53
    int deletePro(Connection con, String id, String professor) throws SQLException;
58
    int deletePro(Connection con, String id, String professor) throws SQLException;
114
    @Where("STATE='1'")
119
    @Where("STATE='1'")
115
    List<Product> queryByOwnerWithPageViews(Connection con, String owner, @Nullable @UnEquals String id, int rows)
120
    List<Product> queryByOwnerWithPageViews(Connection con, String owner, @Nullable @UnEquals String id, int rows)
116
            throws SQLException;
121
            throws SQLException;
122
123
    @Update
124
    @Exclude("modifyTime")
125
    int conUpdate(Connection con, Product product) throws SQLException;
117
}
126
}

+ 38 - 0
src/main/java/com/ekexiu/portal/product/ProductService.java

633
            this.size = size;
633
            this.size = size;
634
        }
634
        }
635
    }
635
    }
636
637
    /**
638
     * 后台管理系统中使用
639
     */
640
    public boolean conUpdate(Connection con, Product product, String[] professor) throws SQLException, IOException {
641
        String id = product.getId();
642
        if (productDao.conUpdate(con, product) > 0) {
643
            this.saveSmallImg(product.getImages());
644
            String[] kws = null;
645
            if (product.getKeywords() != null) {
646
                kws = ListUtil.splitTrimExcludeEmpty(product.getKeywords(), ',').toArray(new String[0]);
647
            }
648
            if (product.getState().equals("1")) {
649
                keyWordService.refreshProduct(con, id, kws);
650
            } else {
651
                keyWordService.deleteProduct(con, id);
652
            }
653
            productDao.deleteProductPro(con, id);
654
            if (professor != null && professor.length > 0) {
655
                for (String pid : professor) {
656
                    ProductPro productPro = new ProductPro();
657
                    productPro.setId(id);
658
                    productPro.setProfessor(pid);
659
                    productDao.insert(con, productPro);
660
                }
661
            }
662
            return true;
663
        }
664
        return false;
665
    }
666
667
    @Post
668
    @Path("/publish/conUpdate")
669
    public boolean conUpdatePublish(@JdbcConn(true) Connection con,
670
                                    @RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Product product, @Nullable String[] professor) throws SQLException, IOException {
671
        product.setState("1");
672
        return conUpdate(con, product, professor);
673
    }
636
}
674
}

+ 4 - 1
src/main/java/com/ekexiu/portal/service/ProfessorService.java

470
				this.professorDao.updateOrgAuth(con, op.getId(), "0");
470
				this.professorDao.updateOrgAuth(con, op.getId(), "0");
471
//				this.demandDao.closeByCreator(con, op.getId(), op.getId());
471
//				this.demandDao.closeByCreator(con, op.getId(), op.getId());
472
				this.orgResStaffDao.deletePro(con, op.getId());
472
				this.orgResStaffDao.deletePro(con, op.getId());
473
				this.orgLinkManDao.deleteByPid(con, op.getId());
474
				this.wareDao.deletePro(con, op.getId());
475
				this.productDao.deletePro(con, op.getId());
473
			}
476
			}
474
		}
477
		}
475
		;
478
		;
752
	public void removeOrgAuth(@JdbcConn(true) Connection con, String id) throws SQLException {
755
	public void removeOrgAuth(@JdbcConn(true) Connection con, String id) throws SQLException {
753
		this.professorDao.updateOrgAuth(con, id, "0");
756
		this.professorDao.updateOrgAuth(con, id, "0");
754
		this.wareDao.deletePro(con, id);
757
		this.wareDao.deletePro(con, id);
755
		this.productDao.deleteProductPro(con, id);
758
		this.productDao.deletePro(con, id);
756
		this.orgLinkManDao.deleteByPid(con, id);
759
		this.orgLinkManDao.deleteByPid(con, id);
757
		this.orgResStaffDao.deletePro(con, id);
760
		this.orgResStaffDao.deletePro(con, id);
758
	}
761
	}