Commit 1cc64067 authored by 谢希宇's avatar 谢希宇

Aidea product update by Strive Date 2020-11-03

parent 7986f736
......@@ -121,6 +121,9 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
JSONObject rtnJson = new JSONObject();
try {
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId);
if (StringUtils.isBlank(name)) {
name = null;
}
List<ConsultSheet> consultSheets = consultSheetMapper.consultSheetList(name, id);
if (consultSheets != null) {
rtnJson.put("errerNo", 0);
......
......@@ -226,7 +226,8 @@
#{clerkId, jdbcType=BIGINT}
)
</insert>
<update id="deleteAll" >
<update id="deleteAll">
update t_order_details set del_flag=1 where id=#{id}
</update>
......@@ -389,9 +390,11 @@
<update id="delete" parameterType="java.lang.Long">
update t_order set del_flag=1 where id=#{id,jdbcType=BIGINT}
</update>
<select id="fetchProduct" resultType="com.cftech.order.model.ProductDto" parameterType="java.util.Map">
SELECT * FROM t_aidea_product WHERE id = #{productId} AND accounts_id=#{accountsId} AND del_flag = 0
</select>
<update id="updateDetill" parameterType="java.util.Map">
update t_order_details
<set>
......@@ -410,9 +413,11 @@
</set>
where order_id =#{id} and id = #{idDetail}
</update>
<select id="fetcheDeta" parameterType="java.util.Map" resultType="java.lang.Integer">
select * from t_order_details where order_id =#{id} and accounts_id=#{accountsId} and drugs_id =#{productId} and del_flag = 0
</select>
<insert id="saveDetill" parameterType="com.cftech.order.model.OrderDetailDto">
insert into t_order_details
(
......@@ -431,6 +436,7 @@
#{accountsId}
)
</insert>
<select id="fetchOrder" resultType="com.cftech.order.model.Order" parameterType="java.lang.Long">
select * from t_order where id= #{id} and del_flag = 0
</select>
......@@ -444,6 +450,7 @@
</set>
where id= #{id}
</update>
<update id="updateStatus" parameterType="java.lang.Long">
update t_order
<set>
......@@ -469,13 +476,15 @@
s.address_name AS addressName,
a.areaname AS province,
b.areaname AS city,
c.areaname AS area
c.areaname AS area,
s.phone,
s.address
FROM
t_order t LEFT JOIN t_shipping_address s ON t.openid = s.open_id
t_order t LEFT JOIN t_shipping_address s ON t.openid = s.open_id AND s.whether = 1
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 AND s.whether = 1
WHERE t.del_flag=0
<if test="id">
AND t.id =#{id}
</if>
......@@ -486,21 +495,21 @@
AND t.status =#{status}
</if>
</select>
<select id="orderDetill" resultType="com.cftech.order.model.ProductMobile">
SELECT
p.product_name AS productName,
t.amount,
p.is_rs AS isrs,
p.product_img AS productImg,
p.format
FROM t_order_details t LEFT JOIN t_aidea_product p
ON t.drugs_id = p.id
WHERE t.del_flag=0 and p.del_flag=0
<if test="orderId!=null">
and t.order_id =#{orderId}
</if>
p.product_name AS productName,
t.amount,
p.is_rs AS isrs,
p.product_img AS productImg,
p.format
FROM t_order_details t LEFT JOIN t_aidea_product p ON t.drugs_id = p.id
WHERE t.del_flag = 0
<if test="orderId!=null">
and t.order_id =#{orderId}
</if>
</select>
<select id="orderSize" resultType="com.cftech.order.model.OrderSizeVO" >
<select id="orderSize" resultType="com.cftech.order.model.OrderSizeVO">
</select>
......
......@@ -64,4 +64,6 @@ public interface ProductclassifyMapper extends GenericDao<Productclassify> {
* @return
*/
String selectIdsByNumber(String classifyNumber);
List<ProductVO> productDosage();
}
\ No newline at end of file
......@@ -213,23 +213,23 @@
</update>
<select id="productList" resultType="com.cftech.productclassify.model.ProductclassifyVO">
SELECT
t.id AS ID,
t.product_name AS productName,
t.classify_id AS classifyId,
t.product_img AS productImg,
t.dosaga_from AS dosagaFrom,
t.common_name AS commonName,
t.format,
t.product_number AS productNumber,
t.accounts_id AS accountsId,
t.is_rs AS isRs,
SELECT
t.id AS ID,
t.product_name AS productName,
t.classify_id AS classifyId,
t.product_img AS productImg,
t.dosaga_from AS dosagaFrom,
t.common_name AS commonName,
t.format,
t.product_number AS productNumber,
t.accounts_id AS accountsId,
t.is_rs AS isRs,
t.size AS size,
t.isreading AS isreading,
t.reading AS reading,
c.classify_name AS classifyName
FROM t_aidea_product t LEFT JOIN t_aidea_product_classify c
ON c.id = t.classify_id WHERE t.del_flag = 0 and c.del_flag = 0
c.classify_name AS classifyName
FROM t_aidea_product t LEFT JOIN t_aidea_product_classify c
ON find_in_set(c.id,t.classify_id) > 0 WHERE t.del_flag = 0 and c.del_flag = 0
<if test="productName !=null">
and
t.product_name like concat('%',#{productName},'%')
......@@ -237,42 +237,49 @@
</if>
<if test="classifyName !=null">
and
c.classify_name = #{classifyName}
c.id = #{classifyName}
</if>
<if test="dosagaFrom !=null">
and
t.dosaga_from = #{dosagaFrom}
</if>
GROUP by t.id
</select>
<!--商品分类菜单数据回填!-->
<select id="productMenu" resultType="com.cftech.productclassify.model.ProductMenuVO">
SELECT
t.id,
t.classify_name AS classifyName,
t.parent_id AS parentId,
a.dosaga_from AS dosagaFrom
FROM t_aidea_product_classify t LEFT JOIN t_aidea_product a ON a.classify_id = t.id AND t.del_flag = 0 and a.del_flag=0
t.id,
t.classify_name AS classifyName,
t.parent_id AS parentId,
a.dosaga_from AS dosagaFrom
FROM t_aidea_product_classify t LEFT JOIN t_aidea_product a ON find_in_set(t.id,a.classify_id) > 0 where t.del_flag = 0 GROUP BY t.id
</select>
<select id="hotproduct" resultType="com.cftech.productclassify.model.ProductVO">
SELECT
id,
product_name AS productName,
format,
product_img AS productImg
FROM t_aidea_product
where del_flag = 0
ORDER BY reading DESC
LIMIT 0,4
SELECT
id,
product_name AS productName,
format,
product_img AS productImg
FROM t_aidea_product
where del_flag = 0
ORDER BY reading DESC
LIMIT 0,4
</select>
<select id="medicine" resultType="com.cftech.productclassify.model.ProductVO">
SELECT
id,
product_name AS productName,
format,
product_img AS productImg
FROM t_aidea_product
WHERE size= 1 and del_flag = 0
LIMIT 0,4
SELECT
id,
product_name AS productName,
format,
product_img AS productImg
FROM t_aidea_product
WHERE size= 1 and del_flag = 0
LIMIT 0,4
</select>
<select id="productDosage" resultType="com.cftech.productclassify.model.ProductVO">
SELECT dosaga_from dosageName FROM t_aidea_product WHERE del_flag = 0 GROUP BY dosaga_from ORDER BY create_time DESC
</select>
</mapper>
\ No newline at end of file
......@@ -14,4 +14,6 @@ public class ProductVO {
private String format;
private String productImg;
private String dosageName;
}
......@@ -42,6 +42,15 @@ public interface ProductclassifyService extends GenericService<Productclassify>
* @return
**/
JSONObject productMenu(String appId);
// /**
// *
// * @Description 商品分类菜单剂型回填
// * @Date 15:16 2020/10/21
// * @Param
// * @return
// **/
// JSONObject productMenu(String appId,String dosageName);
/**
* @Author Licc
* @Description 热门推荐
......@@ -64,5 +73,12 @@ public interface ProductclassifyService extends GenericService<Productclassify>
* @return
*/
String selectIdsByNumber(String classifyNumber);
/**
*
* @Description 商品分类菜单剂型回填
* @Date 15:16 2020/10/21
* @Param
* @return
**/
JSONObject productDosage(String appId, String dosageName);
}
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.StringUtils;
import com.cftech.productclassify.model.ProductMenuVO;
import com.cftech.productclassify.model.ProductVO;
import com.cftech.productclassify.model.Productclassify;
......@@ -57,6 +58,15 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
JSONObject rtnJson = new JSONObject();
try {
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId);
if (StringUtils.isBlank(productName)) {
productName = null;
}
if (StringUtils.isBlank(classifyName)) {
classifyName = null;
}
if (StringUtils.isBlank(dosagaFrom)) {
dosagaFrom = null;
}
List<ProductclassifyVO> productVOS = productclassifyMapper.productList(productName, classifyName, dosagaFrom);
if (productVOS==null){
rtnJson.put("errorNo","1");
......@@ -148,4 +158,27 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
return productclassifyMapper.selectIdsByNumber(classifyNumber);
}
@Override
public JSONObject productDosage(String appId, String dosageName) {
JSONObject rtnJson = new JSONObject();
try {
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId);
List<ProductVO> productVOS = productclassifyMapper.productDosage();
if (productVOS==null){
rtnJson.put("errorNO","1");
rtnJson.put("errorMsg","查询失败");
return rtnJson;
}
Log.info("返回结果:"+productVOS);
rtnJson.put("errorNo","0");
rtnJson.put("data",productVOS);
}catch (Exception e){
e.printStackTrace();
rtnJson.put("errorNO","1");
}
return rtnJson;
}
}
\ No newline at end of file
......@@ -5,10 +5,7 @@ import com.cftech.productclassify.service.ProductclassifyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @author :licc
......@@ -43,6 +40,18 @@ public class MobileclassifyController {
public JSONObject productMenu(String appId){
return ProductclassifyService.productMenu(appId);
}
/**
* @Author Licc
* @Description 商品分类菜单剂型回填
* @Date 9:46 2020/10/22
* @Param []
* @return com.alibaba.fastjson.JSONObject
**/
@RequestMapping(value = "/productDosage",method = {RequestMethod.GET,RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject productDosage(@RequestParam String appId,
@RequestParam(required = false) String dosageName){
return ProductclassifyService.productDosage(appId,dosageName);
}
/**
* @Author Licc
* @Description 热门推荐
......
......@@ -203,7 +203,7 @@ public class ProductController {
retJson.put("errorMsg", "未选择导入文件");
return retJson;
}
// 构造临时路径来存储上传的文件
// 构造临时路径来存储上传的文件
String uploadPath = System.getProperty("java.io.tmpdir");
File uploadDir = new File(uploadPath);
if (!uploadDir.exists()) {
......
......@@ -41,7 +41,7 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog
#\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY
MEMBER_PASSWORD_KEY=DONGCHANGINT9527;
list.refreshtoken=true
jwt.domain=pd.shxrtech.com
jwt.domain=127.0.0.1
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
jwt.duration=86400000
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue
......
......@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.util.HtmlUtils;
import java.text.SimpleDateFormat;
import java.util.Date;
......@@ -113,11 +114,13 @@ public class CfarticleServiceImpl extends GenericServiceImpl<Cfarticle> implemen
List<CfarticleVO> recommended = cfarticleMapper.recommended(id);
if (recommended.size()>0) {
for (CfarticleVO cfarticleVO : recommended) {
// cfarticleVO.setContent(ESAPI.encoder().decodeForHTML(cfarticleVO.getContent()));
String content = cfarticleVO.getContent();
String s1 = StringEscapeUtils.unescapeHtml(content);
String all = s1.replaceAll("&quot;", "\"");
cfarticleVO.setContent(all);
String contents = ESAPI.encoder().decodeForHTML(cfarticleVO.getContent());
String unCond = HtmlUtils.htmlUnescape(contents);
//String value = HtmlUtils.htmlEscape(unCond,"UTF-8");
// String content = cfarticleVO.getContent();
// String s1 = StringEscapeUtils.unescapeHtml(content);
// String all = s1.replaceAll("&quot;", "\"");
cfarticleVO.setContent(unCond);
}
rtnJson.put("errorNo", "0");
rtnJson.put("data", recommended);
......
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