Browse Source

Merge branch 'dev' of http://www.ekexiu.com:3000/jiapeng/portal-web.git into dev

jiapeng 7 years ago
parent
commit
926d6ddc1a

+ 9 - 8
src/main/java/com/ekexiu/portal/ware/WareDao.java

@ -1,5 +1,9 @@
1 1
package com.ekexiu.portal.ware;
2 2

3
import java.sql.Connection;
4
import java.sql.SQLException;
5
import java.util.List;
6

3 7
import org.jfw.apt.annotation.DefaultValue;
4 8
import org.jfw.apt.annotation.Nullable;
5 9
import org.jfw.apt.orm.annotation.dao.Column;
@ -30,10 +34,6 @@ import org.jfw.apt.orm.core.defaultImpl.LongHandler;
30 34
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
31 35
import org.jfw.util.PageQueryResult;
32 36

33
import java.sql.Connection;
34
import java.sql.SQLException;
35
import java.util.List;
36

37 37
@DAO
38 38
public abstract class WareDao {
39 39

@ -141,6 +141,7 @@ public abstract class WareDao {
141 141
	@LimitSelect
142 142
	@OrderBy("ORDER BY MODIFY_TIME DESC")
143 143
	@Where("STATE='1'")
144

144 145
	public abstract List<Ware> queryByResource(Connection con,
145 146
			@SqlColumn(handlerClass = StringHandler.class, value = { "ID IN (SELECT ID FROM WARE_RES WHERE RESOURCE=?)" }) String id, int rows)
146 147
			throws SQLException;
@ -156,10 +157,10 @@ public abstract class WareDao {
156 157
	@Where("STATE='1'")
157 158
	@OrderBy(cols = { @LimitColumn(value = "sortFirst", asc = false, handlerClass = LongHandler.class), @LimitColumn(value = "modifyTime", asc = false),
158 159
			@LimitColumn(value = "id", asc = false) }, value = "")
159
	public abstract List<Ware> indexSearch(Connection con, @Nullable
160
	@GroupSqlColumn(handlerClass = StringHandler.class, value = { "NAME LIKE ?", "CNT LIKE ?", "KEYWORDS LIKE ?",
161
			"CATEGORY='1' AND OWNER IN(SELECT ID FROM PROFESSOR WHERE NAME LIKE ?)",
162
			"CATEGORY ='2' AND OWNER IN(SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE ?)" }, additional = 1, isAnd = false, force = true) String key,
160
	public abstract List<Ware> indexSearch(Connection con,
161
			@Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = { "NAME LIKE ?", "CNT LIKE ?", "KEYWORDS LIKE ?",
162
					"CATEGORY='1' AND OWNER IN(SELECT ID FROM PROFESSOR WHERE NAME LIKE ?)",
163
					"CATEGORY ='2' AND OWNER IN(SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE ?)" }, additional = 1, isAnd = false, force = true) String key,
163 164
			long sortFirst, String modifyTime, String id, int rows) throws SQLException;
164 165

165 166
	@Update

+ 5 - 4
src/main/java/com/ekexiu/portal/ware/WareService.java

@ -264,6 +264,7 @@ public class WareService {
264 264
	 */
265 265
	@Post
266 266
	@Path("/draft/org")
267

267 268
	public String draft(@JdbcConn(true) Connection con,
268 269
			@RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
269 270
			@Nullable String[] resource, @Nullable String[] professor) throws SQLException, IOException {
@ -366,6 +367,7 @@ public class WareService {
366 367
	 */
367 368
	@Post
368 369
	@Path("/publish/update")
370

369 371
	public boolean updatePublish(@JdbcConn(true) Connection con,
370 372
			@RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
371 373
			@Nullable String[] resource) throws SQLException, IOException {
@ -800,7 +802,6 @@ public class WareService {
800 802
		}
801 803
	}
802 804

803

804 805
	/**
805 806
	 * 后台管理系统中使用
806 807
	 */
@ -843,10 +844,10 @@ public class WareService {
843 844
	@Post
844 845
	@Path("/publish/conUpdate")
845 846
	public boolean conUpdatePublish(@JdbcConn(true) Connection con,
846
								 @RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
847
								 @Nullable String[] resource,@Nullable String[] professor) throws SQLException, IOException {
847
			@RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
848
			@Nullable String[] resource, @Nullable String[] professor) throws SQLException, IOException {
848 849
		ware.setState("1");
849
		//ware.setCategory("1");
850
		// ware.setCategory("1");
850 851
		return conUpdate(con, ware, professor, resource);
851 852
	}
852 853
}