Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
Aidea
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sa_aidea
Aidea
Commits
caa5f1a7
Commit
caa5f1a7
authored
Nov 02, 2020
by
黎聪聪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2020年11月2日 19:43:14
parent
08e62f79
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
144 additions
and
6 deletions
+144
-6
ProductclassifyMapper.java
...com/cftech/productclassify/dao/ProductclassifyMapper.java
+18
-0
ProductclassifyMapper.xml
.../com/cftech/productclassify/dao/ProductclassifyMapper.xml
+20
-0
ProductVO.java
...main/java/com/cftech/productclassify/model/ProductVO.java
+17
-0
ProductclassifyService.java
...ftech/productclassify/service/ProductclassifyService.java
+16
-1
ProductclassifyServiceImpl.java
...ductclassify/service/impl/ProductclassifyServiceImpl.java
+50
-5
MobileclassifyController.java
.../cftech/productclassify/web/MobileclassifyController.java
+23
-0
No files found.
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/dao/ProductclassifyMapper.java
View file @
caa5f1a7
package
com
.
cftech
.
productclassify
.
dao
;
package
com
.
cftech
.
productclassify
.
dao
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.productclassify.model.ProductMenuVO
;
import
com.cftech.productclassify.model.ProductMenuVO
;
import
com.cftech.productclassify.model.ProductVO
;
import
com.cftech.productclassify.model.Productclassify
;
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
com.cftech.productclassify.model.ProductclassifyVO
;
...
@@ -39,6 +41,22 @@ public interface ProductclassifyMapper extends GenericDao<Productclassify> {
...
@@ -39,6 +41,22 @@ public interface ProductclassifyMapper extends GenericDao<Productclassify> {
* @return
* @return
**/
**/
List
<
ProductMenuVO
>
productMenu
();
List
<
ProductMenuVO
>
productMenu
();
/**
* @Author Licc
* @Description 热门推荐
* @Date 19:41 2020/11/2
* @Param [appId]
* @return com.alibaba.fastjson.JSONObject
**/
List
<
ProductVO
>
hotproduct
();
/**
* @Author Licc
* @Description 好药推荐
* @Date 19:42 2020/11/2
* @Param [appId]
* @return com.alibaba.fastjson.JSONObject
**/
List
<
ProductVO
>
medicine
();
/**
/**
* 根据分类编码查分类ID
* 根据分类编码查分类ID
...
...
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/dao/ProductclassifyMapper.xml
View file @
caa5f1a7
...
@@ -250,4 +250,24 @@ t.parent_id AS parentId,
...
@@ -250,4 +250,24 @@ 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
FROM t_aidea_product_classify t LEFT JOIN t_aidea_product a ON a.classify_id = t.id AND t.del_flag = 0
</select>
</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
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
LIMIT 0,4
</select>
</mapper>
</mapper>
\ No newline at end of file
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/model/ProductVO.java
0 → 100644
View file @
caa5f1a7
package
com
.
cftech
.
productclassify
.
model
;
import
lombok.Data
;
/**
* @author :licc
* @date :Created in 2020/11/2 19:46
* @description:
*/
@Data
public
class
ProductVO
{
private
Long
id
;
private
String
productName
;
private
String
format
;
private
String
productImg
;
}
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/service/ProductclassifyService.java
View file @
caa5f1a7
...
@@ -42,7 +42,22 @@ public interface ProductclassifyService extends GenericService<Productclassify>
...
@@ -42,7 +42,22 @@ public interface ProductclassifyService extends GenericService<Productclassify>
* @return
* @return
**/
**/
JSONObject
productMenu
(
String
appId
);
JSONObject
productMenu
(
String
appId
);
/**
* @Author Licc
* @Description 热门推荐
* @Date 19:41 2020/11/2
* @Param [appId]
* @return com.alibaba.fastjson.JSONObject
**/
JSONObject
hotproduct
(
String
appId
);
/**
* @Author Licc
* @Description 好药推荐
* @Date 19:42 2020/11/2
* @Param [appId]
* @return com.alibaba.fastjson.JSONObject
**/
JSONObject
medicine
(
String
appId
);
/**
/**
* 根据分类编码查分类ID
* 根据分类编码查分类ID
* @param classifyNumber
* @param classifyNumber
...
...
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/service/impl/ProductclassifyServiceImpl.java
View file @
caa5f1a7
...
@@ -6,6 +6,7 @@ import com.cftech.accounts.model.MpAccountsEntity;
...
@@ -6,6 +6,7 @@ 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.productclassify.model.ProductMenuVO
;
import
com.cftech.productclassify.model.ProductMenuVO
;
import
com.cftech.productclassify.model.ProductVO
;
import
com.cftech.productclassify.model.Productclassify
;
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.model.ProductclassifyVO
;
...
@@ -58,17 +59,17 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
...
@@ -58,17 +59,17 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
MpAccountsEntity
mpAccountsAppid
=
mpAccountsService
.
getMpAccountsAppid
(
appId
);
MpAccountsEntity
mpAccountsAppid
=
mpAccountsService
.
getMpAccountsAppid
(
appId
);
List
<
ProductclassifyVO
>
productVOS
=
productclassifyMapper
.
productList
(
productName
,
classifyName
,
dosagaFrom
);
List
<
ProductclassifyVO
>
productVOS
=
productclassifyMapper
.
productList
(
productName
,
classifyName
,
dosagaFrom
);
if
(
productVOS
==
null
){
if
(
productVOS
==
null
){
rtnJson
.
put
(
"errorN
O
"
,
"1"
);
rtnJson
.
put
(
"errorN
o
"
,
"1"
);
rtnJson
.
put
(
"errorNo"
,
"查询失败"
);
rtnJson
.
put
(
"errorNo"
,
"查询失败"
);
return
rtnJson
;
return
rtnJson
;
}
}
Log
.
info
(
"返回结果:"
+
productVOS
);
Log
.
info
(
"返回结果:"
+
productVOS
);
rtnJson
.
put
(
"errorN
O
"
,
"0"
);
rtnJson
.
put
(
"errorN
o
"
,
"0"
);
rtnJson
.
put
(
"data"
,
productVOS
);
rtnJson
.
put
(
"data"
,
productVOS
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
rtnJson
.
put
(
"errorN
O
"
,
"1"
);
rtnJson
.
put
(
"errorN
o
"
,
"1"
);
}
}
...
@@ -83,18 +84,62 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
...
@@ -83,18 +84,62 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
MpAccountsEntity
mpAccountsAppid
=
mpAccountsService
.
getMpAccountsAppid
(
appId
);
MpAccountsEntity
mpAccountsAppid
=
mpAccountsService
.
getMpAccountsAppid
(
appId
);
List
<
ProductMenuVO
>
menu
=
productclassifyMapper
.
productMenu
();
List
<
ProductMenuVO
>
menu
=
productclassifyMapper
.
productMenu
();
if
(
menu
==
null
){
if
(
menu
==
null
){
rtnJson
.
put
(
"errorN
O
"
,
"1"
);
rtnJson
.
put
(
"errorN
o
"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"查询失败"
);
rtnJson
.
put
(
"errorMsg"
,
"查询失败"
);
return
rtnJson
;
return
rtnJson
;
}
}
Log
.
info
(
"返回结果:"
+
menu
);
Log
.
info
(
"返回结果:"
+
menu
);
rtnJson
.
put
(
"errorN
O
"
,
"0"
);
rtnJson
.
put
(
"errorN
o
"
,
"0"
);
rtnJson
.
put
(
"data"
,
menu
);
rtnJson
.
put
(
"data"
,
menu
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
rtnJson
.
put
(
"errorNo"
,
"1"
);
}
return
rtnJson
;
}
@Override
public
JSONObject
hotproduct
(
String
appId
)
{
JSONObject
rtnJson
=
new
JSONObject
();
try
{
MpAccountsEntity
mpAccountsAppid
=
mpAccountsService
.
getMpAccountsAppid
(
appId
);
List
<
ProductVO
>
hotproduct
=
productclassifyMapper
.
hotproduct
();
if
(
hotproduct
==
null
){
rtnJson
.
put
(
"errorNO"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"查询失败"
);
return
rtnJson
;
}
Log
.
info
(
"返回结果:"
+
hotproduct
);
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"data"
,
hotproduct
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
rtnJson
.
put
(
"errorNO"
,
"1"
);
rtnJson
.
put
(
"errorNO"
,
"1"
);
}
}
return
rtnJson
;
}
@Override
public
JSONObject
medicine
(
String
appId
)
{
JSONObject
rtnJson
=
new
JSONObject
();
try
{
MpAccountsEntity
mpAccountsAppid
=
mpAccountsService
.
getMpAccountsAppid
(
appId
);
List
<
ProductVO
>
medicine
=
productclassifyMapper
.
medicine
();
if
(
medicine
==
null
){
rtnJson
.
put
(
"errorNO"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"查询失败"
);
return
rtnJson
;
}
Log
.
info
(
"返回结果:"
+
medicine
);
rtnJson
.
put
(
"errorNo"
,
"0"
);
rtnJson
.
put
(
"data"
,
medicine
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
rtnJson
.
put
(
"errorNO"
,
"1"
);
}
return
rtnJson
;
return
rtnJson
;
}
}
...
...
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/web/MobileclassifyController.java
View file @
caa5f1a7
...
@@ -44,4 +44,27 @@ public class MobileclassifyController {
...
@@ -44,4 +44,27 @@ 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 19:40 2020/11/2
* @Param
* @return
**/
@RequestMapping
(
value
=
"/hotproduct"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
},
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
JSONObject
hotproduct
(
String
appId
){
return
ProductclassifyService
.
hotproduct
(
appId
);
}
/**
* @Author Licc
* @Description 热门推荐
* @Date 19:40 2020/11/2
* @Param
* @return
**/
@RequestMapping
(
value
=
"/medicine"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
},
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
JSONObject
medicine
(
String
appId
){
return
ProductclassifyService
.
medicine
(
appId
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment