Commit c06927c5 authored by 黎聪聪's avatar 黎聪聪

2020年11月9日 17:39:44

parent 69c85cb6
...@@ -3,6 +3,7 @@ package com.cftech.consultsheet.dao; ...@@ -3,6 +3,7 @@ package com.cftech.consultsheet.dao;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.consultsheet.model.ConsultSheet; import com.cftech.consultsheet.model.ConsultSheet;
import com.cftech.consultsheet.model.ConsultSheetDto;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort; import com.cftech.core.sql.Sort;
...@@ -24,5 +25,5 @@ public interface ConsultSheetMapper extends GenericDao<ConsultSheet> { ...@@ -24,5 +25,5 @@ public interface ConsultSheetMapper extends GenericDao<ConsultSheet> {
List<ConsultSheet> fetchSearchByPage(Conds conds, Sort sort, int page, int pageSize, Long id); List<ConsultSheet> fetchSearchByPage(Conds conds, Sort sort, int page, int pageSize, Long id);
List<ConsultSheet> consultSheetList(@Param("name") String name,@Param("id")Long id,@Param("openid") String openid); List<ConsultSheet> consultSheetList(ConsultSheetDto consultSheetDto);
} }
\ No newline at end of file
...@@ -203,15 +203,18 @@ ...@@ -203,15 +203,18 @@
from t_aidea_consult_sheet from t_aidea_consult_sheet
where del_flag = 0 where del_flag = 0
<if test="openid!=null"> <if test="openid!=null">
and open_id = {openid} and open_id = #{openid}
</if> </if>
<if test="name!=null and name !=''"> <if test="name!=null and name !=''">
and user_name like concat('%',#{name},'%') AND CONCAT(consult_id ) LIKE '%${name}%'
</if> </if>
<if test="id!=null"> <if test="id!=null">
and id = #{id} and id = #{id}
</if> </if>
ORDER BY create_time ORDER BY create_time DESC
<if test="page!=null and pageSize !='' and pageSize!=null and page !=''">
limit #{page},#{pageSize}
</if>
</select> </select>
<update id="update" parameterType="com.cftech.consultsheet.model.ConsultSheet"> <update id="update" parameterType="com.cftech.consultsheet.model.ConsultSheet">
......
package com.cftech.consultsheet.model;
import lombok.Data;
/**
* @author :licc
* @date :Created in 2020/11/9 16:56
* @description:
*/
@Data
public class ConsultSheetDto {
/*搜索条件*/
private String name;
private Long id;
private String appId;
private String openid;
private Long page;
private Long pageSize;
}
...@@ -3,6 +3,7 @@ package com.cftech.consultsheet.service; ...@@ -3,6 +3,7 @@ package com.cftech.consultsheet.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.consultsheet.model.ConsultSheet; import com.cftech.consultsheet.model.ConsultSheet;
import com.cftech.consultsheet.model.ConsultSheetDto;
import com.cftech.core.generic.GenericService; import com.cftech.core.generic.GenericService;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort; import com.cftech.core.sql.Sort;
...@@ -35,7 +36,7 @@ public interface ConsultSheetService extends GenericService<ConsultSheet> { ...@@ -35,7 +36,7 @@ public interface ConsultSheetService extends GenericService<ConsultSheet> {
* @Param * @Param
* @return * @return
**/ **/
JSONObject consultSheetList(String name,Long id,String appId, String openid); JSONObject consultSheetList(ConsultSheetDto consultSheetDto);
void sendQyWechatMassage(ConsultSheet consultSheet); void sendQyWechatMassage(ConsultSheet consultSheet);
} }
...@@ -10,6 +10,7 @@ import com.cftech.base.org.model.Qyuser; ...@@ -10,6 +10,7 @@ import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.service.QyuserService; import com.cftech.base.org.service.QyuserService;
import com.cftech.consultsheet.dao.ConsultSheetMapper; import com.cftech.consultsheet.dao.ConsultSheetMapper;
import com.cftech.consultsheet.model.ConsultSheet; import com.cftech.consultsheet.model.ConsultSheet;
import com.cftech.consultsheet.model.ConsultSheetDto;
import com.cftech.consultsheet.service.ConsultSheetService; import com.cftech.consultsheet.service.ConsultSheetService;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl; import com.cftech.core.generic.GenericServiceImpl;
...@@ -117,14 +118,11 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im ...@@ -117,14 +118,11 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
} }
@Override @Override
public JSONObject consultSheetList(String name, Long id, String appId,String openid) { public JSONObject consultSheetList(ConsultSheetDto consultSheetDto) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
try { try {
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(consultSheetDto.getAppId());
if (StringUtils.isBlank(name)) { List<ConsultSheet> consultSheets = consultSheetMapper.consultSheetList(consultSheetDto);
name = null;
}
List<ConsultSheet> consultSheets = consultSheetMapper.consultSheetList(name, id,openid);
if (consultSheets != null) { if (consultSheets != null) {
rtnJson.put("errerNo", 0); rtnJson.put("errerNo", 0);
rtnJson.put("data", consultSheets); rtnJson.put("data", consultSheets);
......
...@@ -2,6 +2,7 @@ package com.cftech.consultsheet.web; ...@@ -2,6 +2,7 @@ package com.cftech.consultsheet.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.consultsheet.model.ConsultSheet; import com.cftech.consultsheet.model.ConsultSheet;
import com.cftech.consultsheet.model.ConsultSheetDto;
import com.cftech.consultsheet.service.ConsultSheetService; import com.cftech.consultsheet.service.ConsultSheetService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -30,7 +31,7 @@ public class MobileConsultSheetController { ...@@ -30,7 +31,7 @@ public class MobileConsultSheetController {
} }
/** /**
* @Author Licc * @Author Licc
* @Description 咨询单列表 * @Description 咨询单列表 搜索
* @Date 13:01 2020/11/1 * @Date 13:01 2020/11/1
* @Param * @Param
* @return * @return
...@@ -38,8 +39,8 @@ public class MobileConsultSheetController { ...@@ -38,8 +39,8 @@ public class MobileConsultSheetController {
@RequestMapping(value = "/consultSheetList", @RequestMapping(value = "/consultSheetList",
method = {RequestMethod.GET, RequestMethod.POST}, method = {RequestMethod.GET, RequestMethod.POST},
produces = MediaType.APPLICATION_JSON_UTF8_VALUE) produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject consultSheetList(String name,Long id,String appId,String openid) { public JSONObject consultSheetList(ConsultSheetDto consultSheetDto) {
return consultSheetService.consultSheetList(name, id, appId,openid); return consultSheetService.consultSheetList(consultSheetDto);
} }
@RequestMapping(value = "/test", @RequestMapping(value = "/test",
......
...@@ -48,7 +48,7 @@ public interface OrderMapper extends GenericDao<Order> { ...@@ -48,7 +48,7 @@ public interface OrderMapper extends GenericDao<Order> {
* @Date 15:45 2020/10/30 * @Date 15:45 2020/10/30
* @Param * @Param
**/ **/
List<OrderMobile> orderFall(@Param("openid") String openid, @Param("status") Long status, @Param("id") Long id); List<OrderMobile> orderFall(OrderMobileDto orderMobileDto);
/** /**
* @return * @return
...@@ -66,4 +66,12 @@ public interface OrderMapper extends GenericDao<Order> { ...@@ -66,4 +66,12 @@ public interface OrderMapper extends GenericDao<Order> {
* @Param * @Param
**/ **/
OrderSizeVO orderSize(@Param("openid") String openid); OrderSizeVO orderSize(@Param("openid") String openid);
/**
* @return
* @Author Licc
* @Description
* @Date 10:46 2020/11/1
* @Param
**/
List<OrderMobile> orderList(OrderMobileDto orderMobileDto);
} }
\ No newline at end of file
...@@ -487,7 +487,7 @@ ...@@ -487,7 +487,7 @@
<if test="status!=null "> <if test="status!=null ">
AND t.status =#{status} AND t.status =#{status}
</if> </if>
ORDER BY t.create_time ORDER BY t.create_time DESC
</select> </select>
<select id="orderDetill" resultType="com.cftech.order.model.ProductMobile"> <select id="orderDetill" resultType="com.cftech.order.model.ProductMobile">
...@@ -504,7 +504,55 @@ ...@@ -504,7 +504,55 @@
</if> </if>
</select> </select>
<select id="orderSize" resultType="com.cftech.order.model.OrderSizeVO" > <select id="orderSize" resultType="com.cftech.order.model.OrderSizeVO" >
SELECT
SUM(status=0) AS confirm,
SUM(status=2) AS delivered,
SUM(status=3) AS received,
SUM(status=4) AS completed,
SUM(status=5) AS cancelled
FROM t_order WHERE del_flag = 0
</select>
<select id="orderList" resultType="com.cftech.order.model.OrderMobile" parameterType="com.cftech.order.model.OrderMobileDto">
SELECT
t.id,
t.number,
t.pay_status AS payStatus,
t.total_amount AS totalAmount,
t.pay_time AS payTime,
t.trade_no AS tradeNo,
t.courier_number AS courierNumber,
t.order_cancel AS orderCancel,
t.status,
t.create_time AS createTime,
s.address_name AS addressName,
a.areaname AS province,
b.areaname AS city,
c.areaname AS area,
s.phone,
s.address
FROM
t_order t LEFT JOIN t_shipping_address s ON t.openid = s.open_id AND s.whether = 1
LEFT JOIN t_order_details d ON t.id =d.order_id
LEFT JOIN t_aidea_product p ON d.drugs_id = p.id
LEFT JOIN area a ON s.province_id = a.areaid
LEFT JOIN area b ON s.city_id = b.areaid
LEFT JOIN area c ON s.area_id = c.areaid
WHERE t.del_flag=0
<if test="openid !=null and openid!= ''">
AND t.openid =#{openid}
</if>
<if test="searchName!=null and searchName !=''">
AND CONCAT(t.number, p.product_name) LIKE '%${searchName}%'
</if>
<if test="status!=null ">
AND t.status = #{status}
</if>
ORDER BY t.create_time DESC
<if test="page!=null and pageSize !='' and pageSize!=null and page !=''">
limit #{page},#{pageSize}
</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
package com.cftech.order.model;
import lombok.Data;
/**
* @author :licc
* @date :Created in 2020/11/9 14:03
* @description:
*/
@Data
public class OrderMobileDto {
private String openid;
private String search;
private String searchName;
private Long status;
private Long page;
private Long pageSize;
private Long id;
}
...@@ -3,11 +3,8 @@ package com.cftech.order.service; ...@@ -3,11 +3,8 @@ package com.cftech.order.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort; import com.cftech.core.sql.Sort;
import com.cftech.order.model.Order; import com.cftech.order.model.*;
import com.cftech.core.generic.GenericService; import com.cftech.core.generic.GenericService;
import com.cftech.order.model.OrderFromVO;
import com.cftech.order.model.ProductMobile;
import com.cftech.order.model.ProductOrder;
import com.qiniu.util.Json; import com.qiniu.util.Json;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -38,7 +35,7 @@ public interface OrderService extends GenericService<Order> { ...@@ -38,7 +35,7 @@ public interface OrderService extends GenericService<Order> {
* @Param * @Param
* @return * @return
**/ **/
JSONObject confirm(String openid,Long status,Long id); JSONObject confirm(OrderMobileDto orderMobileDto);
/** /**
* @Author Licc * @Author Licc
* @Description 订单数量 * @Description 订单数量
...@@ -48,4 +45,13 @@ public interface OrderService extends GenericService<Order> { ...@@ -48,4 +45,13 @@ public interface OrderService extends GenericService<Order> {
**/ **/
JSONObject orderSize(String openid); JSONObject orderSize(String openid);
/**
* @Author Licc
* @Description 根据搜索条件查询订单
* @Date 19:05 2020/11/3
* @Param
* @return
**/
JSONObject orderList(OrderMobileDto orderMobileDto);
} }
...@@ -156,26 +156,21 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -156,26 +156,21 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
} }
@Override @Override
public com.alibaba.fastjson.JSONObject confirm(String openid,Long status,Long id) { public com.alibaba.fastjson.JSONObject confirm(OrderMobileDto orderMobileDto) {
com.alibaba.fastjson.JSONObject rtnJson = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject rtnJson = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
try { try {
if (StringUtils.isEmpty(openid)){ if (StringUtils.isEmpty(orderMobileDto.getOpenid())){
rtnJson.put("errorNo","0"); rtnJson.put("errorNo","0");
rtnJson.put("errorMsg","openid不能为空"); rtnJson.put("errorMsg","openid不能为空");
return rtnJson; return rtnJson;
} }
if (status==null){ if (orderMobileDto.getStatus()==null){
rtnJson.put("errorNo","0"); rtnJson.put("errorNo","0");
rtnJson.put("errorMsg","status不能为空"); rtnJson.put("errorMsg","status不能为空");
return rtnJson; return rtnJson;
} }
if (id==null){ List<OrderMobile> orderMobiles = orderMapper.orderFall(orderMobileDto);
rtnJson.put("errorNo","0");
rtnJson.put("errorMsg","id不能为空");
return rtnJson;
}
List<OrderMobile> orderMobiles = orderMapper.orderFall(openid, status, id);
for (OrderMobile orderMobile : orderMobiles) { for (OrderMobile orderMobile : orderMobiles) {
Long mobileId = orderMobile.getId(); Long mobileId = orderMobile.getId();
if (mobileId!=null){ if (mobileId!=null){
...@@ -199,6 +194,11 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -199,6 +194,11 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
public com.alibaba.fastjson.JSONObject orderSize(String openid) { public com.alibaba.fastjson.JSONObject orderSize(String openid) {
com.alibaba.fastjson.JSONObject rtnJson = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject rtnJson = new com.alibaba.fastjson.JSONObject();
try{ try{
if (StringUtils.isEmpty(openid)){
rtnJson.put("errorNo","0");
rtnJson.put("errorMsg","openid不能为空");
return rtnJson;
}
OrderSizeVO productMobiles = orderMapper.orderSize(openid); OrderSizeVO productMobiles = orderMapper.orderSize(openid);
if (productMobiles!=null){ if (productMobiles!=null){
rtnJson.put("errorNo","0"); rtnJson.put("errorNo","0");
...@@ -213,4 +213,37 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -213,4 +213,37 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
return rtnJson; return rtnJson;
} }
@Override
public com.alibaba.fastjson.JSONObject orderList(OrderMobileDto orderMobileDto) {
com.alibaba.fastjson.JSONObject rtnJson = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
try{
if (StringUtils.isEmpty(orderMobileDto.getOpenid())){
rtnJson.put("errorNo","0");
rtnJson.put("errorMsg","openid不能为空");
return rtnJson;
}
if (orderMobileDto.getStatus()==null){
rtnJson.put("errorNo","0");
rtnJson.put("errorMsg","订单状态不能为空");
return rtnJson;
}
List<OrderMobile> orderMobiles = orderMapper.orderList(orderMobileDto);
for (OrderMobile orderMobile : orderMobiles) {
Long mobileId = orderMobile.getId();
if (mobileId!=null){
List<ProductMobile> mobiles = orderMapper.orderDetill(mobileId);
orderMobile.setProductMobile(mobiles);
}
}
object.put("orderMobiles", orderMobiles);
rtnJson.put("errorNo","0");
rtnJson.put("data",object);
}catch (Exception e){
e.printStackTrace();
rtnJson.put("errorNo", "1");
}
return rtnJson;
}
} }
\ No newline at end of file
package com.cftech.order.web; package com.cftech.order.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.order.model.OrderMobileDto;
import com.cftech.order.service.OrderService; import com.cftech.order.service.OrderService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -19,37 +21,40 @@ import org.springframework.web.bind.annotation.*; ...@@ -19,37 +21,40 @@ import org.springframework.web.bind.annotation.*;
public class MobileOrderController { public class MobileOrderController {
@Autowired @Autowired
private OrderService orderService; private OrderService orderService;
/** /**
* @return
* @Author Licc * @Author Licc
* @Description 待确认订单 * @Description 订单信息
* @Date 15:43 2020/10/30 * @Date 15:43 2020/10/30
* @Param * @Param
**/
@RequestMapping(value = "/confirm", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject confirm(OrderMobileDto orderMobileDto) {
return orderService.confirm(orderMobileDto);
}
/**
* @return * @return
* @Author Licc
* @Description 订单数量
* @Date 19:03 2020/11/3
* @Param
**/
@RequestMapping(value = "/orderSize", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject orderSize(String openid) {
return orderService.orderSize(openid);
}
/**
* @return
* @Author Licc
* @Description 根据搜索条件查询订单
* @Date 19:40 2020/11/3
* @Param
**/ **/
@RequestMapping(value = "/confirm",method = {RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/orderList", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject confirm(String openid, Long status,Long id){ public JSONObject orderList(OrderMobileDto orderMobileDto) {
return orderService.confirm(openid,status,id); return orderService.orderList(orderMobileDto);
} }
// /**
// * @Author Licc
// * @Description 订单数量
// * @Date 19:03 2020/11/3
// * @Param
// * @return
// **/
// @RequestMapping(value = "/orderSize",method = {RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
// public JSONObject orderSize(String openid){
// return orderService.orderSize(openid);
// }
// /**
// * @Author Licc
// * @Description 根据搜索条件查询订单
// * @Date 19:40 2020/11/3
// * @Param
// * @return
// **/
// @RequestMapping(value = "/orderSize",method = {RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
// public JSONObject orderSize(String openid){
// return orderService.orderSize(openid);
// }
} }
package com.cftech.productclassify.dao; package com.cftech.productclassify.dao;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.productclassify.model.ProductMenuVO; import com.cftech.productclassify.model.*;
import com.cftech.productclassify.model.ProductVO;
import com.cftech.productclassify.model.Productclassify;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.productclassify.model.ProductclassifyVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -32,7 +29,7 @@ public interface ProductclassifyMapper extends GenericDao<Productclassify> { ...@@ -32,7 +29,7 @@ public interface ProductclassifyMapper extends GenericDao<Productclassify> {
* @Param * @Param
* @return * @return
**/ **/
List<ProductclassifyVO> productList(@Param("productName") String productName, @Param("classifyName") String classifyName, @Param("dosagaFrom") String dosagaFrom); List<ProductclassifyVO> productList(ProductclassifyDto productclassifyDto);
/** /**
* *
* @Description 商品分类菜单数据回填 * @Description 商品分类菜单数据回填
......
...@@ -233,22 +233,22 @@ ...@@ -233,22 +233,22 @@
<if test="productName !=null and productName!=''"> <if test="productName !=null and productName!=''">
and and
t.product_name like concat('%',#{productName},'%') t.product_name like concat('%',#{productName},'%')
</if> </if>
<if test="classifyName !=null and productName!=''"> <if test="classifyName !=null and classifyName!=''">
and and
c.classify_name = #{classifyName} c.id = #{classifyName}
</if> </if>
<if test="dosagaFrom !=null and productName!=''"> <if test="dosagaFrom !=null and dosagaFrom!=''">
and and
t.dosaga_from = #{dosagaFrom} t.dosaga_from = #{dosagaFrom}
</if> </if>
GROUP by t.id GROUP by t.id
ORDER BY ORDER BY
t.create_time t.create_time
DESC DESC
<if test="page!=null and pageSize !='' and pageSize!=null and page !=''">
limit #{page},#{pageSize}
</if>
</select> </select>
<!--商品分类菜单数据回填!--> <!--商品分类菜单数据回填!-->
<select id="productMenu" resultType="com.cftech.productclassify.model.ProductMenuVO"> <select id="productMenu" resultType="com.cftech.productclassify.model.ProductMenuVO">
......
package com.cftech.productclassify.model;
import lombok.Data;
/**
* @author :licc
* @date :Created in 2020/11/9 14:54
* @description:
*/
@Data
public class ProductclassifyDto {
private String productName;
private Long classifyName;
private String dosagaFrom;
private String appId;
private Long page;
private Long pageSize;
}
...@@ -5,6 +5,7 @@ import com.cftech.core.sql.Conds; ...@@ -5,6 +5,7 @@ import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort; import com.cftech.core.sql.Sort;
import com.cftech.productclassify.model.Productclassify; import com.cftech.productclassify.model.Productclassify;
import com.cftech.core.generic.GenericService; import com.cftech.core.generic.GenericService;
import com.cftech.productclassify.model.ProductclassifyDto;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -33,7 +34,7 @@ public interface ProductclassifyService extends GenericService<Productclassify> ...@@ -33,7 +34,7 @@ public interface ProductclassifyService extends GenericService<Productclassify>
* @Param * @Param
* @return * @return
**/ **/
JSONObject productList(String productName, String classifyName, String dosagaFrom,String appId); JSONObject productList(ProductclassifyDto productclassifyDto);
/** /**
* *
* @Description 商品分类菜单数据回填 * @Description 商品分类菜单数据回填
......
...@@ -6,11 +6,8 @@ import com.cftech.accounts.model.MpAccountsEntity; ...@@ -6,11 +6,8 @@ import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService; import com.cftech.accounts.service.MpAccountsService;
import com.cftech.core.sql.Sort; import com.cftech.core.sql.Sort;
import com.cftech.core.util.StringUtils; import com.cftech.core.util.StringUtils;
import com.cftech.productclassify.model.ProductMenuVO; import com.cftech.productclassify.model.*;
import com.cftech.productclassify.model.ProductVO;
import com.cftech.productclassify.model.Productclassify;
import com.cftech.productclassify.dao.ProductclassifyMapper; import com.cftech.productclassify.dao.ProductclassifyMapper;
import com.cftech.productclassify.model.ProductclassifyVO;
import com.cftech.productclassify.service.ProductclassifyService; import com.cftech.productclassify.service.ProductclassifyService;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl; import com.cftech.core.generic.GenericServiceImpl;
...@@ -54,20 +51,20 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi ...@@ -54,20 +51,20 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
} }
@Override @Override
public JSONObject productList(String productName, String classifyName, String dosagaFrom,String appId) { public JSONObject productList(ProductclassifyDto productclassifyDto) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
try { try {
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(productclassifyDto.getAppId());
if (StringUtils.isBlank(productName)) { // if (StringUtils.isBlank(productclassifyDto.getProductName())) {
productName = null; // productName = null;
} // }
if (StringUtils.isBlank(classifyName)) { // if (StringUtils.isBlank(classifyName)) {
classifyName = null; // classifyName = null;
} // }
if (StringUtils.isBlank(dosagaFrom)) { // if (StringUtils.isBlank(dosagaFrom)) {
dosagaFrom = null; // dosagaFrom = null;
} // }
List<ProductclassifyVO> productVOS = productclassifyMapper.productList(productName, classifyName, dosagaFrom); List<ProductclassifyVO> productVOS = productclassifyMapper.productList(productclassifyDto);
if (productVOS==null){ if (productVOS==null){
rtnJson.put("errorNo","1"); rtnJson.put("errorNo","1");
rtnJson.put("errorNo","查询失败"); rtnJson.put("errorNo","查询失败");
......
package com.cftech.productclassify.web; package com.cftech.productclassify.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.productclassify.model.ProductclassifyDto;
import com.cftech.productclassify.service.ProductclassifyService; import com.cftech.productclassify.service.ProductclassifyService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -26,8 +27,8 @@ public class MobileclassifyController { ...@@ -26,8 +27,8 @@ public class MobileclassifyController {
* @return * @return
**/ **/
@RequestMapping(value = "/productList",method = {RequestMethod.GET,RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/productList",method = {RequestMethod.GET,RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject productList(@RequestParam(required = false) String productName, @RequestParam(required = false)String classifyName,@RequestParam(required = false) String dosagaFrom,@RequestParam(required = true)String appId){ public JSONObject productList(ProductclassifyDto productclassifyDto){
return ProductclassifyService.productList(productName,classifyName,dosagaFrom,appId); return ProductclassifyService.productList(productclassifyDto);
} }
/** /**
* @Author Licc * @Author Licc
......
...@@ -77,7 +77,7 @@ public interface CfarticleMapper extends GenericDao<Cfarticle> { ...@@ -77,7 +77,7 @@ public interface CfarticleMapper extends GenericDao<Cfarticle> {
* @Param * @Param
* @return * @return
**/ **/
List<Cfarticle> gateway(@Param("title") String title); List<Cfarticle> gateway(@Param("title") String title,@Param("page") Long page,@Param("pageSize") Long pageSize);
/** /**
* @Author Licc * @Author Licc
* @Description 栏目列表数据回填 * @Description 栏目列表数据回填
...@@ -94,6 +94,6 @@ public interface CfarticleMapper extends GenericDao<Cfarticle> { ...@@ -94,6 +94,6 @@ public interface CfarticleMapper extends GenericDao<Cfarticle> {
* @Param * @Param
* @return * @return
**/ **/
List<CfarticleVO> columnDetails(@Param("id") Long id); List<CfarticleVO> columnDetails(@Param("id") Long id,@Param("page") Long page,@Param("pageSize") Long pageSize,@Param("title") String title);
} }
\ No newline at end of file
...@@ -431,6 +431,12 @@ SELECT count(*) FROM wx_cms_cfarticle WHERE whether_banner= 1 and del_flag=0 ...@@ -431,6 +431,12 @@ SELECT count(*) FROM wx_cms_cfarticle WHERE whether_banner= 1 and del_flag=0
<if test="title!=null"> <if test="title!=null">
and t.title like '%${title}%' and t.title like '%${title}%'
</if> </if>
ORDER BY
create_time
DESC
<if test="page!=null and pageSize !='' and pageSize!=null and page !=''">
limit #{page},#{pageSize}
</if>
</select> </select>
<select id="column" resultType="com.cftech.cms.cfarticle.model.columnVO"> <select id="column" resultType="com.cftech.cms.cfarticle.model.columnVO">
SELECT SELECT
...@@ -464,9 +470,16 @@ FROM wx_cms_cfarticle ...@@ -464,9 +470,16 @@ FROM wx_cms_cfarticle
WHERE del_flag=0 WHERE del_flag=0
<if test="id!=null"> <if test="id!=null">
AND `column`= #{id} AND `column`= #{id}
</if>
<if test="title!=null and title!=''">
AND CONCAT(title,author) LIKE '%${title}%'
</if> </if>
ORDER BY ORDER BY
create_time create_time
DESC
<if test="page!=null and pageSize !='' and pageSize!=null and page !=''">
limit #{page},#{pageSize}
</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -68,7 +68,7 @@ public interface CfarticleService extends GenericService<Cfarticle> { ...@@ -68,7 +68,7 @@ public interface CfarticleService extends GenericService<Cfarticle> {
* @Param * @Param
* @return * @return
**/ **/
JSONObject geteway(String title,String appId); JSONObject geteway(String title,String appId,Long page,Long pageSize);
/** /**
* @Author Licc * @Author Licc
* @Description 栏目列表列表数据回填 * @Description 栏目列表列表数据回填
...@@ -84,5 +84,5 @@ public interface CfarticleService extends GenericService<Cfarticle> { ...@@ -84,5 +84,5 @@ public interface CfarticleService extends GenericService<Cfarticle> {
* @Param * @Param
* @return * @return
**/ **/
JSONObject columnDetails(Long id,String appId); JSONObject columnDetails(Long id,String appId,Long page,Long pageSize,String title);
} }
...@@ -166,11 +166,11 @@ String unCond = HtmlUtils.htmlUnescape(contents); ...@@ -166,11 +166,11 @@ String unCond = HtmlUtils.htmlUnescape(contents);
} }
@Override @Override
public JSONObject geteway(String title,String appId) { public JSONObject geteway(String title,String appId,Long page,Long pageSize) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
try { try {
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId);
List<Cfarticle> cfarticles = cfarticleMapper.gateway(title); List<Cfarticle> cfarticles = cfarticleMapper.gateway(title,page,pageSize);
if (cfarticles==null){ if (cfarticles==null){
rtnJson.put("errorNo", "1"); rtnJson.put("errorNo", "1");
rtnJson.put("errorMsg","查询失败"); rtnJson.put("errorMsg","查询失败");
...@@ -210,16 +210,11 @@ String unCond = HtmlUtils.htmlUnescape(contents); ...@@ -210,16 +210,11 @@ String unCond = HtmlUtils.htmlUnescape(contents);
} }
@Override @Override
public JSONObject columnDetails(Long id,String appId) { public JSONObject columnDetails(Long id,String appId,Long page,Long pageSize,String title) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
try { try {
if (id==null){
rtnJson.put("errorNo", "1");
rtnJson.put("errorMsg","id不能为空");
return rtnJson;
}
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId);
List<CfarticleVO> cfarticleVOS = cfarticleMapper.columnDetails(id); List<CfarticleVO> cfarticleVOS = cfarticleMapper.columnDetails(id,page,pageSize,title);
if (cfarticleVOS==null){ if (cfarticleVOS==null){
rtnJson.put("errorNo", "1"); rtnJson.put("errorNo", "1");
rtnJson.put("errorMsg","查询失败"); rtnJson.put("errorMsg","查询失败");
......
...@@ -153,8 +153,8 @@ public class MobileCfArticleController { ...@@ -153,8 +153,8 @@ public class MobileCfArticleController {
* @return * @return
**/ **/
@RequestMapping(value = "/gateway", method = {RequestMethod.GET, RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/gateway", method = {RequestMethod.GET, RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public com.alibaba.fastjson.JSONObject gateway(String title,String appId){ public com.alibaba.fastjson.JSONObject gateway(String title,String appId,Long page,Long pageSize){
return cfarticleService.geteway(title,appId); return cfarticleService.geteway(title,appId,page,pageSize);
} }
/** /**
* @Author Licc * @Author Licc
...@@ -169,13 +169,13 @@ public class MobileCfArticleController { ...@@ -169,13 +169,13 @@ public class MobileCfArticleController {
} }
/** /**
* @Author Licc * @Author Licc
* @Description 栏目文章详情 * @Description 栏目文章详情 栏目文章搜索
* @Date 10:34 2020/10/30 * @Date 10:34 2020/10/30
* @Param * @Param
* @return * @return
**/ **/
@RequestMapping(value = "/columnDetails", method = {RequestMethod.GET, RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/columnDetails", method = {RequestMethod.GET, RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public com.alibaba.fastjson.JSONObject columnDetails(Long id,String appId){ public com.alibaba.fastjson.JSONObject columnDetails(Long id,String appId,Long page,Long pageSize,String title){
return cfarticleService.columnDetails(id,appId); return cfarticleService.columnDetails(id,appId,page,pageSize,title);
} }
} }
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