Commit 2b1bb5da by 吴迪

【新增】零售接口

parent 557fe721
...@@ -140,7 +140,7 @@ public class GTINController { ...@@ -140,7 +140,7 @@ public class GTINController {
if (glnRequestBo.getCode().length() < 13) { if (glnRequestBo.getCode().length() < 13) {
R r = new R(); R r = new R();
r.put("code", "500"); r.put("code", "500");
r.put("msg", "商品条码不能少于13位!"); r.put("msg", "商品条码卡位数太少!请输入正确的13位或14位商品条码!");
printWriter.write(JSONUtil.toJsonStr(r)); printWriter.write(JSONUtil.toJsonStr(r));
return; return;
} }
...@@ -173,7 +173,6 @@ public class GTINController { ...@@ -173,7 +173,6 @@ public class GTINController {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
printWriter.flush(); printWriter.flush();
;
printWriter.close(); printWriter.close();
} }
......
...@@ -173,15 +173,11 @@ public class PictureController extends AbstractController { ...@@ -173,15 +173,11 @@ public class PictureController extends AbstractController {
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList") // @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R retailPictureList(@RequestBody Map<String, String> params) { public R retailPictureList(@RequestBody Map<String, String> params) {
try { try {
QueryWrapper<PictureEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.gt("PicLevel","0");
queryWrapper.eq("status","1");
queryWrapper.like("keyword","零售").or().like("keyword","全渠道").like("keyword","商品二维码");
queryWrapper.orderByDesc("PicLevel","PictureId","showtime");
IPage<PictureEntity> page = pictureService.page(new Page(Integer.valueOf(params.get("page")),
Integer.valueOf(params.get("size"))), queryWrapper);
PageUtils pageUtils = new PageUtils(page); Page page = new Page(Long.parseLong(params.get("page")),Long.parseLong(params.get("size")));
Page<PictureEntity> pictureEntityPage = pictureService.selectRetailPicture(page);
PageUtils pageUtils = new PageUtils(pictureEntityPage);
return R.ok().put("data", pageUtils); return R.ok().put("data", pageUtils);
} catch (Exception e) { } catch (Exception e) {
log.error("pictureList error:", e); log.error("pictureList error:", e);
......
...@@ -23,4 +23,7 @@ public interface PictureDao extends BaseMapper<PictureEntity> { ...@@ -23,4 +23,7 @@ public interface PictureDao extends BaseMapper<PictureEntity> {
List<PictureEntity> selectPictureList(@Param("params") PictureParams params, Page page); List<PictureEntity> selectPictureList(@Param("params") PictureParams params, Page page);
List<PictureEntity> selectPictureNewList(@Param("params")NewsParams params, Page page); List<PictureEntity> selectPictureNewList(@Param("params")NewsParams params, Page page);
List<PictureEntity> selectRetailPicture (Page page);
} }
...@@ -34,5 +34,8 @@ public interface PictureService extends IService<PictureEntity> { ...@@ -34,5 +34,8 @@ public interface PictureService extends IService<PictureEntity> {
Page<PictureEntity> selectPictureList(PictureParams params, Page page); Page<PictureEntity> selectPictureList(PictureParams params, Page page);
Page<PictureEntity> selectPictureNewList(NewsParams params, Page page); Page<PictureEntity> selectPictureNewList(NewsParams params, Page page);
Page<PictureEntity> selectRetailPicture(Page page);
} }
...@@ -120,4 +120,11 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i ...@@ -120,4 +120,11 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i
return page; return page;
} }
@Override
public Page<PictureEntity> selectRetailPicture(Page page) {
List<PictureEntity> newsList = this.pictureDao.selectRetailPicture(page);
page.setRecords(newsList);
return page;
}
} }
\ No newline at end of file
...@@ -82,4 +82,13 @@ ...@@ -82,4 +82,13 @@
ORDER BY PicLevel DESC, ORDER BY PicLevel DESC,
pictureid DESC pictureid DESC
</select> </select>
<select id="selectRetailPicture" resultMap="pictureMap">
select * from V_retailPicture order by INPUTdate desc,
PicLevel DESC,
pictureid DESC
</select>
</mapper> </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