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