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
1ac2b19d
Commit
1ac2b19d
authored
Oct 22, 2020
by
黎聪聪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
药品接口
parent
4cc1a94f
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
460 additions
and
35 deletions
+460
-35
productclassifyform.html
...pp/WEB-INF/views/productclassify/productclassifyform.html
+2
-2
ProductclassifyMapper.java
...com/cftech/productclassify/dao/ProductclassifyMapper.java
+19
-1
ProductclassifyMapper.xml
.../com/cftech/productclassify/dao/ProductclassifyMapper.xml
+40
-0
ProductMenuVO.java
.../java/com/cftech/productclassify/model/ProductMenuVO.java
+19
-0
ProductclassifyVO.java
...a/com/cftech/productclassify/model/ProductclassifyVO.java
+28
-0
ProductclassifyService.java
...ftech/productclassify/service/ProductclassifyService.java
+18
-0
ProductclassifyServiceImpl.java
...ductclassify/service/impl/ProductclassifyServiceImpl.java
+48
-0
MobileclassifyController.java
.../cftech/productclassify/web/MobileclassifyController.java
+45
-0
ProductMapper.java
...e/src/main/java/com/cftech/product/dao/ProductMapper.java
+12
-1
ProductMapper.xml
...le/src/main/java/com/cftech/product/dao/ProductMapper.xml
+32
-0
ProductVO.java
...ule/src/main/java/com/cftech/product/model/ProductVO.java
+59
-0
ProductService.java
.../main/java/com/cftech/product/service/ProductService.java
+12
-0
ProductServiceImpl.java
...a/com/cftech/product/service/impl/ProductServiceImpl.java
+85
-27
MobileProductController.java
.../java/com/cftech/product/web/MobileProductController.java
+35
-0
MemberMapper.xml
...dule/src/main/java/com/cftech/member/dao/MemberMapper.xml
+2
-2
AddressMapper.xml
...e/src/main/java/com/cftech/addresst/dao/AddressMapper.xml
+3
-1
MobileAddressController.java
...java/com/cftech/addresst/web/MobileAddressController.java
+1
-1
No files found.
aidea-modules/product-classify-module-web/src/main/webapp/WEB-INF/views/productclassify/productclassifyform.html
View file @
1ac2b19d
...
...
@@ -81,7 +81,7 @@
<div
class=
"box-body"
>
</div>
<
!--<
div class="form-group form-md-line-input col-md-12">
<div
class=
"form-group form-md-line-input col-md-12"
>
<label>
上级分类
</label>
<div
class=
"input-group"
>
<input
type=
"text"
id=
"parentId"
name=
"parentId"
value=
"$!{data.parentId}"
...
...
@@ -93,7 +93,7 @@
class=
"btn btn-info btn-flat"
>
选择
</button>
</span>
</div>
</div>
-->
</div>
<div
class=
"form-group form-md-line-input col-md-12"
>
<label>
产品分类名称
</label>
...
...
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/dao/ProductclassifyMapper.java
View file @
1ac2b19d
package
com
.
cftech
.
productclassify
.
dao
;
import
com.cftech.productclassify.model.ProductMenuVO
;
import
com.cftech.productclassify.model.Productclassify
;
import
com.cftech.core.generic.GenericDao
;
import
com.cftech.productclassify.model.ProductclassifyVO
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -20,5 +23,20 @@ public interface ProductclassifyMapper extends GenericDao<Productclassify> {
* @return
*/
List
<
Productclassify
>
fetchTreeByPage
(
Map
<
String
,
Object
>
params
);
/**
*
* @Description 商品列表展示
* @Date 15:19 2020/10/21
* @Param
* @return
**/
List
<
ProductclassifyVO
>
productList
(
@Param
(
"productName"
)
String
productName
,
@Param
(
"classifyName"
)
String
classifyName
,
@Param
(
"dosagaFrom"
)
String
dosagaFrom
);
/**
*
* @Description 商品分类菜单数据回填
* @Date 15:19 2020/10/21
* @Param
* @return
**/
List
<
ProductMenuVO
>
productMenu
();
}
\ No newline at end of file
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/dao/ProductclassifyMapper.xml
View file @
1ac2b19d
...
...
@@ -146,6 +146,7 @@
<if
test=
"limit>0"
>
limit #{offset},#{limit}
</if>
</select>
<update
id=
"update"
parameterType=
"com.cftech.productclassify.model.Productclassify"
>
update t_aidea_product_classify
<set>
...
...
@@ -198,4 +199,43 @@
<update
id=
"delete"
parameterType=
"java.lang.Long"
>
update t_aidea_product_classify set del_flag=1 where id=#{id,jdbcType=BIGINT}
</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,
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
<if
test=
"productName !=null"
>
and
t.product_name like concat('%',#{productName},'%')
</if>
<if
test=
"classifyName !=null"
>
and
c.classify_name = #{classifyName}
</if>
<if
test=
"dosagaFrom !=null"
>
and
t.dosaga_from = #{dosagaFrom}
</if>
</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
</select>
</mapper>
\ No newline at end of file
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/model/ProductMenuVO.java
0 → 100644
View file @
1ac2b19d
package
com
.
cftech
.
productclassify
.
model
;
import
lombok.Data
;
/**
* @author :licc
* @date :Created in 2020/10/22 9:55
* @description:
*/
@Data
public
class
ProductMenuVO
{
private
Long
Id
;
/*分类名称*/
private
String
classifyName
;
/*产品分类ID*/
private
String
parentId
;
/*剂型*/
private
String
dosagaFrom
;
}
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/model/ProductclassifyVO.java
0 → 100644
View file @
1ac2b19d
package
com
.
cftech
.
productclassify
.
model
;
import
lombok.Data
;
/**
* @author :licc
* @date :Created in 2020/10/21 17:49
* @description:
*/
@Data
public
class
ProductclassifyVO
{
/*商品主键id*/
private
Long
ID
;
/*商品名称*/
private
String
productName
;
/*产品分类ID*/
private
String
classifyId
;
/*商品图片*/
private
String
productImg
;
/*分类名称*/
private
String
classifyName
;
/*剂型*/
private
String
dosagaFrom
;
/*通用名*/
private
String
commonName
;
/*规格*/
private
String
format
;
}
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/service/ProductclassifyService.java
View file @
1ac2b19d
package
com
.
cftech
.
productclassify
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.core.sql.Conds
;
import
com.cftech.core.sql.Sort
;
import
com.cftech.productclassify.model.Productclassify
;
...
...
@@ -25,4 +26,21 @@ public interface ProductclassifyService extends GenericService<Productclassify>
* @return
*/
List
<
Productclassify
>
fetchTreeByPage
(
Conds
conds
,
Sort
sort
,
int
pageNo
,
int
pageSize
);
/**
*
* @Description 商品列表展示
* @Date 15:16 2020/10/21
* @Param
* @return
**/
JSONObject
productList
(
String
productName
,
String
classifyName
,
String
dosagaFrom
);
/**
*
* @Description 商品分类菜单数据回填
* @Date 15:16 2020/10/21
* @Param
* @return
**/
JSONObject
productMenu
();
}
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/service/impl/ProductclassifyServiceImpl.java
View file @
1ac2b19d
package
com
.
cftech
.
productclassify
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.core.sql.Sort
;
import
com.cftech.productclassify.model.ProductMenuVO
;
import
com.cftech.productclassify.model.Productclassify
;
import
com.cftech.productclassify.dao.ProductclassifyMapper
;
import
com.cftech.productclassify.model.ProductclassifyVO
;
import
com.cftech.productclassify.service.ProductclassifyService
;
import
com.cftech.core.generic.GenericDao
;
import
com.cftech.core.generic.GenericServiceImpl
;
import
com.cftech.core.sql.Conds
;
import
com.esotericsoftware.minlog.Log
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
...
...
@@ -43,4 +48,47 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
return
productclassifyMapper
.
fetchTreeByPage
(
params
);
}
@Override
public
JSONObject
productList
(
String
productName
,
String
classifyName
,
String
dosagaFrom
)
{
JSONObject
rtnJson
=
new
JSONObject
();
try
{
List
<
ProductclassifyVO
>
productVOS
=
productclassifyMapper
.
productList
(
productName
,
classifyName
,
dosagaFrom
);
if
(
productVOS
==
null
){
rtnJson
.
put
(
"errorNO"
,
"1"
);
rtnJson
.
put
(
"errorNo"
,
"查询失败"
);
}
Log
.
info
(
"返回结果:"
+
productVOS
);
rtnJson
.
put
(
"errorNO"
,
"0"
);
rtnJson
.
put
(
"data"
,
productVOS
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
rtnJson
.
put
(
"errorNO"
,
"1"
);
}
return
rtnJson
;
}
@Override
public
JSONObject
productMenu
()
{
JSONObject
rtnJson
=
new
JSONObject
();
try
{
List
<
ProductMenuVO
>
menu
=
productclassifyMapper
.
productMenu
();
if
(
menu
==
null
){
rtnJson
.
put
(
"errorNO"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"查询失败"
);
}
Log
.
info
(
"返回结果:"
+
menu
);
rtnJson
.
put
(
"errorNO"
,
"0"
);
rtnJson
.
put
(
"data"
,
menu
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
rtnJson
.
put
(
"errorNO"
,
"1"
);
}
return
rtnJson
;
}
}
\ No newline at end of file
aidea-modules/product-classify-module/src/main/java/com/cftech/productclassify/web/MobileclassifyController.java
0 → 100644
View file @
1ac2b19d
package
com
.
cftech
.
productclassify
.
web
;
import
com.alibaba.fastjson.JSONObject
;
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.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author :licc
* @date :Created in 2020/10/21 17:46
* @description:
*/
@Slf4j
@RestController
@RequestMapping
(
"mobile/auth/productclassify"
)
public
class
MobileclassifyController
{
@Autowired
private
com
.
cftech
.
productclassify
.
service
.
ProductclassifyService
ProductclassifyService
;
/**
* @Author Licc
* @Description 商品列表展示
* @Date 14:14 2020/10/21
* @Param
* @return
**/
@RequestMapping
(
value
=
"/productList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
},
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
JSONObject
productList
(
String
productName
,
String
classifyName
,
String
dosagaFrom
){
return
ProductclassifyService
.
productList
(
productName
,
classifyName
,
dosagaFrom
);
}
/**
* @Author Licc
* @Description 商品分类菜单数据回填
* @Date 9:46 2020/10/22
* @Param []
* @return com.alibaba.fastjson.JSONObject
**/
@RequestMapping
(
value
=
"/productMenu"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
},
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
JSONObject
productMenu
(){
return
ProductclassifyService
.
productMenu
();
}
}
aidea-modules/product-module/src/main/java/com/cftech/product/dao/ProductMapper.java
View file @
1ac2b19d
...
...
@@ -2,6 +2,10 @@ package com.cftech.product.dao;
import
com.cftech.product.model.Product
;
import
com.cftech.core.generic.GenericDao
;
import
com.cftech.product.model.ProductVO
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 产品Mapper
...
...
@@ -10,5 +14,12 @@ import com.cftech.core.generic.GenericDao;
* @date: 2020-09-24 15:07
*/
public
interface
ProductMapper
extends
GenericDao
<
Product
>
{
/**
*
* @Description 根据id查询商品详情
* @Date 15:19 2020/10/21
* @Param
* @return
**/
List
<
ProductVO
>
product
(
@Param
(
"ID"
)
Long
ID
);
}
\ No newline at end of file
aidea-modules/product-module/src/main/java/com/cftech/product/dao/ProductMapper.xml
View file @
1ac2b19d
...
...
@@ -89,6 +89,29 @@
is_rs
</sql>
<sql
id=
"productList"
>
t.id AS ID,
t.product_name AS productName,
t.classify_id AS classifyId,
t.product_img AS productImg,
t.recommend_measure AS recommendMeasure,
t.dosaga_from AS dosagaFrom,
t.common_name AS commonName,
t.format,
t.approve_number AS approveNumber,
t.manufacturer,
t.description,
t.tips,
t.take_type AS takeType,
t.take_frequency AS takeFrequency,
t.take_amount AS takeAmount,
t.stock,
t.price,
t.is_rs AS isRs,
t.product_number AS productNumber,
t.accounts_id AS accountsId,
c.classify_name AS classifyName
</sql>
<insert
id=
"save"
parameterType=
"com.cftech.product.model.Product"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
...
...
@@ -181,6 +204,7 @@
<if
test=
"limit>0"
>
limit #{offset},#{limit}
</if>
</select>
<update
id=
"update"
parameterType=
"com.cftech.product.model.Product"
>
update t_aidea_product
<set>
...
...
@@ -266,4 +290,12 @@
<update
id=
"delete"
parameterType=
"java.lang.Long"
>
update t_aidea_product set del_flag=1 where id=#{id,jdbcType=BIGINT}
</update>
<!-- 根据ID查询商品详情!-->
<select
id=
"product"
resultType=
"com.cftech.product.model.ProductVO"
>
select
<include
refid=
"productList"
/>
FROM t_aidea_product t LEFT JOIN t_aidea_product_classify c
ON c.id = t.classify_id WHERE t.del_flag=0 and t.id= #{ID}
</select>
</mapper>
\ No newline at end of file
aidea-modules/product-module/src/main/java/com/cftech/product/model/ProductVO.java
0 → 100644
View file @
1ac2b19d
package
com
.
cftech
.
product
.
model
;
import
com.sun.xml.bind.v2.model.core.ID
;
import
lombok.Data
;
/**
* @author :licc
* @date :Created in 2020/10/21 14:24
* @description:
*/
@Data
public
class
ProductVO
{
/*商品主键id*/
private
Long
ID
;
/*商品名称*/
private
String
productName
;
/*产品分类ID*/
private
String
classifyId
;
/*商品图片*/
private
String
productImg
;
/*推荐剂量*/
private
String
recommendMeasure
;
/*剂型*/
private
String
dosagaFrom
;
/*通用名*/
private
String
commonName
;
/*规格*/
private
String
format
;
/*批准文号*/
private
String
approveNumber
;
/*生产企业*/
private
String
manufacturer
;
/*药品简介*/
private
String
description
;
/*温馨提示*/
private
String
tips
;
/*服用类型*/
private
String
takeType
;
/*服用频率*/
private
String
takeFrequency
;
/*服用次数*/
private
String
takeAmount
;
/*库存*/
private
Long
stock
;
/*价格*/
private
Double
price
;
/*是否为处方药*/
private
String
isRs
;
/*产品编码*/
private
String
productNumber
;
/*销量*/
private
Long
sales
;
/*accounts_id*/
private
Long
accountsId
;
/*分类名称*/
private
String
classifyName
;
}
aidea-modules/product-module/src/main/java/com/cftech/product/service/ProductService.java
View file @
1ac2b19d
package
com
.
cftech
.
product
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.product.model.Product
;
import
com.cftech.core.generic.GenericService
;
import
com.cftech.product.model.ProductVO
;
/**
* 产品Service
*
...
...
@@ -16,4 +19,13 @@ public interface ProductService extends GenericService<Product> {
* @param product
*/
boolean
saveProduct
(
Product
product
);
/**
* @Author Licc
* @Description 根据id查询商品详情
* @Date 11:08 2020/10/22
* @Param
* @return
**/
JSONObject
productId
(
Long
ID
);
}
aidea-modules/product-module/src/main/java/com/cftech/product/service/impl/ProductServiceImpl.java
View file @
1ac2b19d
package
com
.
cftech
.
product
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.base.codingrule.utils.CodingruleUtils
;
import
com.cftech.core.util.StringUtils
;
import
com.cftech.product.model.Product
;
import
com.cftech.product.dao.ProductMapper
;
import
com.cftech.product.model.ProductVO
;
import
com.cftech.product.service.ProductService
;
import
com.cftech.core.generic.GenericDao
;
import
com.cftech.core.generic.GenericServiceImpl
;
...
...
@@ -12,6 +14,7 @@ import com.cftech.productdetail.dao.ProductDetailMapper;
import
com.cftech.productdetail.model.ProductDetail
;
import
com.cftech.productintowareroom.dao.ProductIntoWareroomMapper
;
import
com.cftech.productintowareroom.model.ProductIntoWareroom
;
import
com.esotericsoftware.minlog.Log
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
...
...
@@ -31,6 +34,7 @@ import java.util.Map;
@Service
(
"productService"
)
public
class
ProductServiceImpl
extends
GenericServiceImpl
<
Product
>
implements
ProductService
{
@Autowired
@Qualifier
(
"productMapper"
)
private
ProductMapper
productMapper
;
...
...
@@ -52,40 +56,71 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P
/**
* 保存导入商品信息并生成商品入库单记录和商品明细记录
*
* @param product
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
saveProduct
(
Product
product
){
public
boolean
saveProduct
(
Product
product
)
{
// 1、保存商品实体 根据商品编码判断该商品是否存在 存在则更新 不存在则新增
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Conds
conds
=
new
Conds
();
conds
.
equal
(
"a.product_number"
,
product
.
getProductNumber
());
conds
.
equal
(
"a.del_flag"
,
0
);
params
.
put
(
"conds"
,
conds
);
conds
.
equal
(
"a.product_number"
,
product
.
getProductNumber
());
conds
.
equal
(
"a.del_flag"
,
0
);
params
.
put
(
"conds"
,
conds
);
List
<
Product
>
listProduct
=
productMapper
.
fetchSearchByPage
(
params
);
if
(
listProduct
.
size
()
>
0
)
{
if
(
listProduct
.
size
()
>
0
)
{
Product
productEntity
=
listProduct
.
get
(
0
);
if
(
StringUtils
.
isNotBlank
(
product
.
getClassifyNumber
())){
productEntity
.
setClassifyNumber
(
product
.
getClassifyNumber
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getProductName
())){
productEntity
.
setProductName
(
product
.
getProductName
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getCommonName
())){
productEntity
.
setCommonName
(
product
.
getCommonName
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getDosagaFrom
())){
productEntity
.
setDosagaFrom
(
product
.
getDosagaFrom
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getFormat
())){
productEntity
.
setFormat
(
product
.
getFormat
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getApproveNumber
())){
productEntity
.
setApproveNumber
(
product
.
getApproveNumber
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getManufacturer
())){
productEntity
.
setManufacturer
(
product
.
getManufacturer
());
}
if
(
StringUtils
.
isNoneBlank
(
product
.
getRecommendMeasure
())){
productEntity
.
setRecommendMeasure
(
product
.
getRecommendMeasure
());
}
if
(
StringUtils
.
isNoneBlank
(
product
.
getDescription
())){
productEntity
.
setDescription
(
product
.
getDescription
());
}
if
(
StringUtils
.
isNoneBlank
(
product
.
getTips
())){
productEntity
.
setTips
(
product
.
getTips
());
}
if
(
StringUtils
.
isNoneBlank
(
product
.
getTakeType
())){
productEntity
.
setTakeType
(
product
.
getTakeType
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getTakeFrequency
())){
productEntity
.
setTakeFrequency
(
product
.
getTakeFrequency
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getTakeAmount
())){
productEntity
.
setTakeAmount
(
product
.
getTakeAmount
());
}
if
(
StringUtils
.
isNotBlank
(
String
.
valueOf
(
product
.
getStock
()))){
if
(
StringUtils
.
isNotBlank
(
product
.
getClassifyNumber
()))
{
productEntity
.
setClassifyNumber
(
product
.
getClassifyNumber
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getProductName
()))
{
productEntity
.
setProductName
(
product
.
getProductName
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getCommonName
()))
{
productEntity
.
setCommonName
(
product
.
getCommonName
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getDosagaFrom
()))
{
productEntity
.
setDosagaFrom
(
product
.
getDosagaFrom
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getFormat
()))
{
productEntity
.
setFormat
(
product
.
getFormat
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getApproveNumber
()))
{
productEntity
.
setApproveNumber
(
product
.
getApproveNumber
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getManufacturer
()))
{
productEntity
.
setManufacturer
(
product
.
getManufacturer
());
}
if
(
StringUtils
.
isNoneBlank
(
product
.
getRecommendMeasure
()))
{
productEntity
.
setRecommendMeasure
(
product
.
getRecommendMeasure
());
}
if
(
StringUtils
.
isNoneBlank
(
product
.
getDescription
()))
{
productEntity
.
setDescription
(
product
.
getDescription
());
}
if
(
StringUtils
.
isNoneBlank
(
product
.
getTips
()))
{
productEntity
.
setTips
(
product
.
getTips
());
}
if
(
StringUtils
.
isNoneBlank
(
product
.
getTakeType
()))
{
productEntity
.
setTakeType
(
product
.
getTakeType
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getTakeFrequency
()))
{
productEntity
.
setTakeFrequency
(
product
.
getTakeFrequency
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getTakeAmount
()))
{
productEntity
.
setTakeAmount
(
product
.
getTakeAmount
());
}
if
(
StringUtils
.
isNotBlank
(
String
.
valueOf
(
product
.
getStock
())))
{
productEntity
.
setStock
((
new
BigDecimal
(
productEntity
.
getStock
()).
add
(
new
BigDecimal
(
product
.
getStock
()))).
longValue
());
}
if
(
StringUtils
.
isNotBlank
(
String
.
valueOf
(
product
.
getPrice
()))){
productEntity
.
setPrice
(
product
.
getPrice
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getIsRs
()))
{
productEntity
.
setIsRs
(
product
.
getIsRs
());
}
if
(
StringUtils
.
isNotBlank
(
String
.
valueOf
(
product
.
getPrice
())))
{
productEntity
.
setPrice
(
product
.
getPrice
());
}
if
(
StringUtils
.
isNotBlank
(
product
.
getIsRs
()))
{
productEntity
.
setIsRs
(
product
.
getIsRs
());
}
productMapper
.
update
(
productEntity
);
}
else
{
}
else
{
productMapper
.
save
(
product
);
}
...
...
@@ -107,12 +142,12 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P
// 3、生成商品明细表
ProductDetail
productDetail
=
null
;
if
(
product
.
getStock
()
!=
null
&&
product
.
getStock
()
>
0
){
for
(
int
i
=
0
;
i
<
product
.
getStock
().
intValue
();
i
++){
if
(
product
.
getStock
()
!=
null
&&
product
.
getStock
()
>
0
)
{
for
(
int
i
=
0
;
i
<
product
.
getStock
().
intValue
();
i
++)
{
productDetail
=
new
ProductDetail
();
productDetail
.
setAccountsId
(
product
.
getAccountsId
());
productDetail
.
setProductDetailNumber
(
codingruleUtils
.
getNumber
(
product
.
getAccountsId
(),
ProductDetail
.
class
.
getName
()));
productDetail
.
setMaterielNumber
(
codingruleUtils
.
getNumber
(
product
.
getAccountsId
(),
"com.cftech.productmaterie.model.Materie"
));
productDetail
.
setProductDetailNumber
(
codingruleUtils
.
getNumber
(
product
.
getAccountsId
(),
ProductDetail
.
class
.
getName
()));
productDetail
.
setMaterielNumber
(
codingruleUtils
.
getNumber
(
product
.
getAccountsId
(),
"com.cftech.productmaterie.model.Materie"
));
productDetail
.
setProductNumber
(
product
.
getProductNumber
());
productDetail
.
setProductName
(
product
.
getProductName
());
productDetail
.
setProductClassifyNumber
(
product
.
getClassifyNumber
());
...
...
@@ -128,5 +163,28 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P
return
true
;
}
@Override
public
JSONObject
productId
(
Long
ID
)
{
JSONObject
rtnJson
=
new
JSONObject
();
try
{
if
(
ID
.
equals
(
""
)){
rtnJson
.
put
(
"errorNO"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"id不能为空"
);
}
List
<
ProductVO
>
product
=
productMapper
.
product
(
ID
);
if
(
product
==
null
){
rtnJson
.
put
(
"errorNO"
,
"1"
);
rtnJson
.
put
(
"errorMsg"
,
"查询失败"
);
}
Log
.
info
(
"返回结果:"
+
product
);
rtnJson
.
put
(
"errorNO"
,
"0"
);
rtnJson
.
put
(
"data"
,
product
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
rtnJson
.
put
(
"errorNO"
,
"1"
);
}
return
rtnJson
;
}
}
\ No newline at end of file
aidea-modules/product-module/src/main/java/com/cftech/product/web/MobileProductController.java
0 → 100644
View file @
1ac2b19d
package
com
.
cftech
.
product
.
web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.product.service.ProductService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
sun.util.resources.cldr.gv.LocaleNames_gv
;
/**
* @author :licc
* @date :Created in 2020/10/21 14:10
* @description:药品分类
*/
@Slf4j
@RestController
@RequestMapping
(
"mobile/auth/product"
)
public
class
MobileProductController
{
@Autowired
private
ProductService
productService
;
/**
* @Author Licc
* @Description 根据id查询商品详情
* @Date 11:05 2020/10/22
* @Param
* @return
**/
@RequestMapping
(
value
=
"/productId"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
},
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
JSONObject
productMenu
(
Long
ID
){
return
productService
.
productId
(
ID
);
}
}
membercard-modules/member-module/src/main/java/com/cftech/member/dao/MemberMapper.xml
View file @
1ac2b19d
...
...
@@ -179,7 +179,7 @@
offline.phone memberPhone,
offline.storeid memberStoreId
FROM wx_mp_member t
left join wx_mp_member_offline offline on offline.member_id = t.member_id
left join wx_mp_member_offline offline on offline.member_id = t.member_id
and t.del_flag=0
WHERE t.id=#{id}
</select>
...
...
@@ -354,7 +354,7 @@
-->
<select
id=
"memberFormation"
parameterType=
"java.lang.Long"
resultType=
"com.cftech.member.model.MemberVO"
>
SELECT `name` AS memberName,sex,birthday,imageurl,email AS mailbox,phone
FROM wx_mp_member WHERE id= #{Id}
FROM wx_mp_member WHERE id= #{Id}
and del_flag=0
</select>
<!--个人信息修改
-->
...
...
membercard-modules/shipping-address-module/src/main/java/com/cftech/addresst/dao/AddressMapper.xml
View file @
1ac2b19d
...
...
@@ -149,6 +149,7 @@
LEFT JOIN area a ON t.province_id = a.areaid
LEFT JOIN area b ON t.city_id = b.areaid
LEFT JOIN area c ON t.area_id = c.areaid
and t.del_flag=0
WHERE t.open_id = #{openId}
</select>
...
...
@@ -159,6 +160,7 @@
LEFT JOIN area a ON t.province_id = a.areaid
LEFT JOIN area b ON t.city_id = b.areaid
LEFT JOIN area c ON t.area_id = c.areaid
and t.del_flag=0
WHERE t.id=#{id}
</select>
...
...
@@ -254,6 +256,6 @@
select areaid,areaname,affiliationareaId,citytype from area
</select>
<select
id=
"whetherList"
resultType=
"java.lang.Integer"
>
select * from t_shipping_address where open_id = #{openId} and whether=1
select * from t_shipping_address where open_id = #{openId} and whether=1
and del_flag=0
</select>
</mapper>
\ No newline at end of file
membercard-modules/shipping-address-module/src/main/java/com/cftech/addresst/web/MobileAddressController.java
View file @
1ac2b19d
...
...
@@ -18,7 +18,7 @@ import java.util.List;
/**
* @author :licc
* @date :Created in 2020/10/19 18:11
* @description:收货地址
修改
* @description:收货地址
*/
@Slf4j
@RestController
...
...
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