Commit d7b0b0f7 authored by 王晓旭's avatar 王晓旭
parents d53a11d9 2ba30dbf
......@@ -13,5 +13,5 @@ import java.util.List;
public interface PageInfoDao extends ICRUDDao<PageInfoEntity,Long>{
List<PageInfoEntity> getProductList();
}
package com.mortals.xhx.module.page.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.module.page.dao.PageInfoDao;
import com.mortals.xhx.module.page.model.PageInfoEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 产品页面配置DaoImpl DAO接口
......@@ -17,5 +17,8 @@ import java.util.List;
public class PageInfoDaoImpl extends BaseCRUDDaoMybatis<PageInfoEntity,Long> implements PageInfoDao {
@Override
public List<PageInfoEntity> getProductList() {
return this.getSqlSession().selectList(this.getSqlId("getProductList"));
}
}
package com.mortals.xhx.module.page.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.page.model.PageInfoEntity;
import java.util.ArrayList;
import java.util.List;
/**
* 产品页面配置视图对象
*
......@@ -11,4 +8,13 @@ import java.util.List;
*/
public class PageInfoVo extends BaseEntityLong {
private Long platformId;
public Long getPlatformId() {
return platformId;
}
public void setPlatformId(Long platformId) {
this.platformId = platformId;
}
}
\ No newline at end of file
......@@ -3,6 +3,9 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.page.model.PageInfoEntity;
import java.util.List;
/**
* PageInfoService
*
......@@ -21,4 +24,6 @@ public interface PageInfoService extends ICRUDService<PageInfoEntity,Long>{
* @throws AppException
*/
PageInfoEntity saveScreen(PageInfoEntity entity, Context context) throws AppException;
List<PageInfoEntity> getProductList() throws AppException;
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ import com.mortals.xhx.module.page.model.PageInfoEntity;
import com.mortals.xhx.module.page.service.PageInfoService;
import java.util.Date;
import java.util.List;
/**
* PageInfoService
......@@ -82,6 +83,11 @@ public class PageInfoServiceImpl extends AbstractCRUDServiceImpl<PageInfoDao, Pa
}
}
@Override
public List<PageInfoEntity> getProductList() throws AppException {
return dao.getProductList();
}
private void doSaveImageBase64(PageInfoEntity entity,String oldName){
String base64 = String.valueOf(entity.getScreenUrl());
base64 = base64.replaceAll("data:image/png;base64,","");
......
......@@ -6,7 +6,6 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.product.ProductPdu;
import com.mortals.xhx.feign.product.IProductFeign;
import com.mortals.xhx.module.page.model.PageInfoEntity;
......@@ -57,18 +56,14 @@ public class PageInfoController extends BaseCRUDJsonBodyMappingController<PageIn
Context context = this.getContext();
String busiDesc = "查询产品列表";
int code;
int code=1;
try {
Rest<RespData<List<ProductPdu>>> result = productFeign.list(query);
code = result.getCode();
if(code > 0) {
model.put("data", result.getData().getData());
model.put("pageInfo", result.getData().getPageInfo());
model.put("dict", result.getData().getDict());
model.put("message_info", busiDesc + "成功");
}else {
model.put("message_info", result.getMsg());
List<PageInfoEntity> result = service.getProductList();
for(PageInfoEntity item:result){
item.setPlatformId(item.getProductId());
}
model.put("data", result);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.page.dao.ibatis.PageInfoDaoImpl">
<select id="getProductList" resultMap="PageInfoEntity-Map">
SELECT DISTINCT t.productId,t.productName FROM mortals_xhx_page_info t ORDER BY t.productId;
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment