Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
Overview
Overview
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
hooloo
ms
soss
Commits
3f6f5969
Commit
3f6f5969
authored
Jun 02, 2022
by
张新旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
什么时候是个头,是个头
parent
c6311946
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
120 additions
and
54 deletions
+120
-54
soss-admin/src/main/java/com/soss/web/controller/coffee/AppController.java
+13
-1
soss-admin/src/main/java/com/soss/web/controller/coffee/ApplicationController.java
+13
-6
soss-admin/src/main/java/com/soss/web/controller/coffee/WechatMessageController.java
+0
-1
soss-admin/src/main/java/com/soss/web/controller/coffee/WeixinController.java
+2
-2
soss-admin/src/main/java/com/soss/web/controller/system/SysRoleController.java
+4
-1
soss-framework/src/main/java/com/soss/framework/web/service/WeixinServiceImpl.java
+4
-28
soss-system/src/main/java/com/soss/system/domain/vo/OrderQuery.java
+32
-0
soss-system/src/main/java/com/soss/system/mapper/OrderMapper.java
+2
-0
soss-system/src/main/java/com/soss/system/mapper/ShopMapper.java
+2
-0
soss-system/src/main/java/com/soss/system/service/impl/AppServiceImpl.java
+17
-6
soss-system/src/main/java/com/soss/system/service/impl/OrderServiceImpl.java
+2
-2
soss-system/src/main/java/com/soss/system/service/impl/ShopServiceImpl.java
+3
-0
soss-system/src/main/java/com/soss/system/service/impl/WechatMessageServiceImpl.java
+5
-2
soss-system/src/main/resources/mapper/system/OrderMapper.xml
+16
-4
soss-system/src/main/resources/mapper/system/ShopMapper.xml
+4
-0
soss-system/src/main/resources/mapper/system/SysMenuMapper.xml
+1
-1
No files found.
soss-admin/src/main/java/com/soss/web/controller/coffee/AppController.java
View file @
3f6f5969
package
com
.
soss
.
web
.
controller
.
coffee
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.soss.common.core.controller.BaseController
;
import
com.soss.common.core.domain.AjaxResult
;
...
...
@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -55,7 +57,17 @@ public class AppController extends BaseController {
return
AjaxResult
.
success
(
"操作成功"
,
info
);
}
@RequestMapping
(
"/getWaitTine"
)
public
AjaxResult
getWaitTime
(
@RequestBody
Order
order
){
public
AjaxResult
getWaitTime
(
@RequestBody
String
body
){
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
body
);
Order
order
=
new
Order
();
order
.
setShopId
(
jsonObject
.
getString
(
"shopId"
));
JSONArray
goods
=
jsonObject
.
getJSONArray
(
"goods"
);
List
<
OrderDetail
>
orderDetails
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
goods
.
size
();
i
++){
OrderDetail
orderDetail
=
new
OrderDetail
();
orderDetail
.
setGoodsId
(
goods
.
getJSONObject
(
i
).
getString
(
"goodsId"
));
orderDetails
.
add
(
orderDetail
);
}
String
info
=
orderService
.
getWaitTime
(
order
);
return
AjaxResult
.
success
(
"操作成功"
,
info
);
}
...
...
soss-admin/src/main/java/com/soss/web/controller/coffee/ApplicationController.java
View file @
3f6f5969
...
...
@@ -5,11 +5,9 @@ import com.soss.common.core.domain.AjaxResult;
import
com.soss.common.exception.ServiceException
;
import
com.soss.common.utils.uuid.UUID
;
import
com.soss.system.domain.Machine
;
import
com.soss.system.domain.Shop
;
import
com.soss.system.jiguang.impl.JiGuangPushServiceImpl
;
import
com.soss.system.service.impl.MachineServiceImpl
;
import
com.soss.system.service.impl.OrderServiceImpl
;
import
com.soss.system.service.impl.OrderTakingServiceImpl
;
import
com.soss.system.service.impl.ShopServiceImpl
;
import
com.soss.system.service.impl.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -43,8 +41,17 @@ public class ApplicationController {
return
AjaxResult
.
success
(
"处理成功"
,
key
);
}
@RequestMapping
(
"/getData"
)
public
AjaxResult
getApplicationData
(
String
key
){
public
AjaxResult
getApplicationData
(
String
body
){
JSONObject
jj
=
JSONObject
.
parseObject
(
body
);
String
key
=
jj
.
getString
(
"key"
);
JSONObject
location
=
jj
.
getJSONObject
(
"location"
);
String
s
=
stringRedisTemplate
.
opsForValue
().
get
(
key
);
JSONObject
info
=
JSONObject
.
parseObject
(
s
);
String
machineCode
=
info
.
getString
(
"machineCode"
);
Machine
machine
=
machineService
.
selectMachineByCode
(
machineCode
);
Shop
shop
=
shopService
.
selectShopById
(
String
.
valueOf
(
machine
.
getShopId
()));
shop
.
setDistance
(
AppServiceImpl
.
GetDistance
(
Double
.
parseDouble
(
shop
.
getLng
()),
Double
.
parseDouble
(
shop
.
getLat
()),
Double
.
parseDouble
(
location
.
getString
(
"lng"
)),
Double
.
parseDouble
(
location
.
getString
(
"lat"
))));
info
.
put
(
"shop"
,
shop
);
String
[]
keys
=
key
.
split
(
"_"
);
//推送数据给安卓
JSONObject
jsonObject
=
new
JSONObject
();
...
...
@@ -55,7 +62,7 @@ public class ApplicationController {
jsonObject
.
put
(
"data"
,
data
);
jiGuangPushService
.
push
(
keys
[
0
],
jsonObject
);
// stringRedisTemplate.delete(key);
return
AjaxResult
.
success
(
"处理成功"
,
s
);
return
AjaxResult
.
success
(
"处理成功"
,
info
.
toJSONString
()
);
}
@RequestMapping
(
"/jgRegister"
)
public
AjaxResult
jgRegister
(
@RequestParam
String
machineCode
,
@RequestParam
String
registerId
){
...
...
soss-admin/src/main/java/com/soss/web/controller/coffee/WechatMessageController.java
View file @
3f6f5969
...
...
@@ -93,7 +93,6 @@ public class WechatMessageController extends BaseController
/**
* 修改小程序信息发送
*/
@PreAuthorize
(
"@ss.hasPermi('system:message:edit')"
)
@Log
(
title
=
"小程序信息发送"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
WechatMessage
wechatMessage
)
...
...
soss-admin/src/main/java/com/soss/web/controller/coffee/WeixinController.java
View file @
3f6f5969
...
...
@@ -82,8 +82,8 @@ public class WeixinController {
}
@RequestMapping
(
"/getShop"
)
public
AjaxResult
getShop
(
@RequestParam
(
required
=
false
)
String
lng
,
@RequestParam
(
required
=
false
)
String
lat
){
return
AjaxResult
.
success
(
appService
.
getShop
(
lng
,
lat
));
public
AjaxResult
getShop
(){
return
AjaxResult
.
success
(
appService
.
getShop
());
}
@RequestMapping
(
"/getArea"
)
public
AjaxResult
getArea
(
@RequestParam
(
required
=
false
)
String
lng
,
@RequestParam
(
required
=
false
)
String
lat
){
...
...
soss-admin/src/main/java/com/soss/web/controller/system/SysRoleController.java
View file @
3f6f5969
...
...
@@ -127,7 +127,10 @@ public class SysRoleController extends BaseController
}
return
AjaxResult
.
error
(
"修改角色'"
+
role
.
getRoleName
()
+
"'失败,请联系管理员"
);
}
@GetMapping
(
"/status"
)
public
AjaxResult
status
(
SysRole
role
){
return
AjaxResult
.
success
(
roleService
.
updateRole
(
role
));
}
/**
* 修改保存数据权限
*/
...
...
soss-framework/src/main/java/com/soss/framework/web/service/WeixinServiceImpl.java
View file @
3f6f5969
...
...
@@ -32,6 +32,7 @@ import com.soss.system.mapper.OrderMapper;
import
com.soss.system.mapper.OrderRefundMapper
;
import
com.soss.system.mapper.ShopMapper
;
import
com.soss.system.service.IWechatMessageService
;
import
com.soss.system.service.impl.AppServiceImpl
;
import
com.soss.system.service.impl.MachineApiServiceImpl
;
import
com.soss.system.service.impl.OrderOperationLogServiceImpl
;
import
com.soss.system.weixin.entity.OrderInfo
;
...
...
@@ -573,9 +574,8 @@ public class WeixinServiceImpl {
List
<
JSONObject
>
proviceList
=
new
ArrayList
<>();
List
<
String
>
proString
=
new
ArrayList
<>();
for
(
Shop
shop1
:
shops
)
{
double
v
=
GetDistance
(
Double
.
parseDouble
(
lng
),
Double
.
parseDouble
(
lat
),
Double
.
parseDouble
(
shop1
.
getLng
()),
Double
.
parseDouble
(
shop1
.
getLat
()));
DecimalFormat
df
=
new
DecimalFormat
(
"0.00"
);
shop1
.
setDistance
(
df
.
format
(
v
));
String
aa
=
AppServiceImpl
.
GetDistance
(
Double
.
parseDouble
(
lng
),
Double
.
parseDouble
(
lat
),
Double
.
parseDouble
(
shop1
.
getLng
()),
Double
.
parseDouble
(
shop1
.
getLat
()));
shop1
.
setDistance
(
aa
);
String
province
=
shop1
.
getProvince
();
if
(
proString
.
contains
(
province
)){
for
(
JSONObject
provinceObject
:
proviceList
)
{
...
...
@@ -650,32 +650,7 @@ public class WeixinServiceImpl {
return
proviceList
;
}
private
static
final
double
EARTH_RADIUS
=
6378137
;
/**
* 根据两点间经纬度坐标(double值),计算两点间距离,单位为米
* @param lng1
* @param lat1
* @param lng2
* @param lat2
* @return
*/
public
static
double
GetDistance
(
double
lng1
,
double
lat1
,
double
lng2
,
double
lat2
)
{
double
radLat1
=
rad
(
lat1
);
double
radLat2
=
rad
(
lat2
);
double
a
=
radLat1
-
radLat2
;
double
b
=
rad
(
lng1
)
-
rad
(
lng2
);
double
s
=
2
*
Math
.
asin
(
Math
.
sqrt
(
Math
.
pow
(
Math
.
sin
(
a
/
2
),
2
)
+
Math
.
cos
(
radLat1
)*
Math
.
cos
(
radLat2
)*
Math
.
pow
(
Math
.
sin
(
b
/
2
),
2
)));
s
=
s
*
EARTH_RADIUS
;
s
=
Math
.
round
(
s
*
10000
)
/
10000
;
return
s
;
}
private
static
double
rad
(
double
d
)
{
return
d
*
Math
.
PI
/
180.0
;
}
public
String
refresh
(
String
phoneNumber
)
{
Customer
customer
=
new
Customer
();
...
...
@@ -683,6 +658,7 @@ public class WeixinServiceImpl {
List
<
Customer
>
customers
=
customerMapper
.
selectCustomerList
(
customer
);
if
(
customers
!=
null
&&!
customers
.
isEmpty
()){
Customer
customer1
=
customers
.
get
(
0
);
log
.
info
(
"当前登录的用户为:【{}】"
,
customer1
.
getUserName
());
return
tokenService
.
createToken
(
transLoginUser
(
customer1
));
}
...
...
soss-system/src/main/java/com/soss/system/domain/vo/OrderQuery.java
View file @
3f6f5969
...
...
@@ -55,6 +55,38 @@ public class OrderQuery extends BaseEntity {
//用户昵称
private
String
userName
;
public
String
getCreateAtStart
()
{
return
createAtStart
;
}
public
void
setCreateAtStart
(
String
createAtStart
)
{
this
.
createAtStart
=
createAtStart
;
}
public
String
getCreateAtEnd
()
{
return
createAtEnd
;
}
public
void
setCreateAtEnd
(
String
createAtEnd
)
{
this
.
createAtEnd
=
createAtEnd
;
}
public
String
getPayAtStart
()
{
return
payAtStart
;
}
public
void
setPayAtStart
(
String
payAtStart
)
{
this
.
payAtStart
=
payAtStart
;
}
public
String
getPayAtEnd
()
{
return
payAtEnd
;
}
public
void
setPayAtEnd
(
String
payAtEnd
)
{
this
.
payAtEnd
=
payAtEnd
;
}
private
Long
shopId
;
private
String
createAtStart
;
...
...
soss-system/src/main/java/com/soss/system/mapper/OrderMapper.java
View file @
3f6f5969
...
...
@@ -72,6 +72,8 @@ public interface OrderMapper
List
<
Order
>
selectOrder
(
@Param
(
"status"
)
List
<
String
>
status
,
@Param
(
"machineId"
)
String
machineCode
);
List
<
Order
>
selectOrderByShopId
(
@Param
(
"status"
)
List
<
String
>
status
,
@Param
(
"shopId"
)
String
shopId
);
Order
selectHomeByUserId
(
@Param
(
"userId"
)
String
openId
,
@Param
(
"status"
)
List
<
String
>
status
);
void
updateTimeOut
(
@Param
(
"status"
)
String
productionCompleted
,
@Param
(
"timeout"
)
String
timeout
);
...
...
soss-system/src/main/java/com/soss/system/mapper/ShopMapper.java
View file @
3f6f5969
...
...
@@ -58,4 +58,6 @@ public interface ShopMapper
* @return 结果
*/
public
int
deleteShopByIds
(
String
[]
ids
);
void
updateNoDefault
();
}
soss-system/src/main/java/com/soss/system/service/impl/AppServiceImpl.java
View file @
3f6f5969
...
...
@@ -14,7 +14,7 @@ import java.util.stream.Collectors;
public
class
AppServiceImpl
{
@Autowired
private
ShopMapper
shopMapper
;
public
Shop
getShop
(
String
lng
,
String
lat
)
{
public
Shop
getShop
()
{
Shop
shop
=
new
Shop
();
shop
.
setState
(
"1"
);
...
...
@@ -22,9 +22,6 @@ public class AppServiceImpl {
List
<
Shop
>
shops
=
shopMapper
.
selectShopList
(
shop
);
if
(
shops
!=
null
&&!
shops
.
isEmpty
()){
Shop
shop1
=
shops
.
get
(
0
);
double
v
=
GetDistance
(
Double
.
parseDouble
(
lng
),
Double
.
parseDouble
(
lat
),
Double
.
parseDouble
(
shop1
.
getLng
()),
Double
.
parseDouble
(
shop1
.
getLat
()));
DecimalFormat
df
=
new
DecimalFormat
(
"0.00"
);
shop1
.
setDistance
(
df
.
format
(
v
));
return
shop1
;
}
else
{
return
new
Shop
();
...
...
@@ -43,7 +40,7 @@ public class AppServiceImpl {
* @param lat2
* @return
*/
public
static
double
GetDistance
(
double
lng1
,
double
lat1
,
double
lng2
,
double
lat2
)
public
static
String
GetDistance
(
double
lng1
,
double
lat1
,
double
lng2
,
double
lat2
)
{
double
radLat1
=
rad
(
lat1
);
double
radLat2
=
rad
(
lat2
);
...
...
@@ -53,7 +50,21 @@ public class AppServiceImpl {
Math
.
cos
(
radLat1
)*
Math
.
cos
(
radLat2
)*
Math
.
pow
(
Math
.
sin
(
b
/
2
),
2
)));
s
=
s
*
EARTH_RADIUS
;
s
=
Math
.
round
(
s
*
10000
)
/
10000
;
return
s
;
String
distance
=
null
;
if
(
s
>
1000
&&
s
<
10000
){
DecimalFormat
df
=
new
DecimalFormat
(
"######0.0"
);
distance
=
df
.
format
(
s
/
1000
);
return
distance
+
"公里"
;
}
else
if
(
s
>=
10000
){
Double
aDouble
=
s
/
10000
;
return
aDouble
.
intValue
()+
"公里"
;
}
else
{
Double
aDouble
=
s
;
return
aDouble
.
intValue
()+
"公里"
;
}
}
private
static
double
rad
(
double
d
)
...
...
soss-system/src/main/java/com/soss/system/service/impl/OrderServiceImpl.java
View file @
3f6f5969
...
...
@@ -352,9 +352,9 @@ public class OrderServiceImpl implements IOrderService
}
public
String
getWaitTime
(
Order
order
)
{
String
machineId
=
order
.
getMachine
Id
();
String
shopId
=
order
.
getShop
Id
();
List
<
String
>
status
=
Arrays
.
asList
(
"2"
,
"3"
);
List
<
Order
>
orders
=
orderMapper
.
selectOrder
(
status
,
machine
Id
);
List
<
Order
>
orders
=
orderMapper
.
selectOrder
ByShopId
(
status
,
shop
Id
);
List
<
OrderDetail
>
list
=
new
ArrayList
<>();
list
.
addAll
(
order
.
getOrderDetails
());
for
(
Order
order1
:
orders
)
{
...
...
soss-system/src/main/java/com/soss/system/service/impl/ShopServiceImpl.java
View file @
3f6f5969
...
...
@@ -109,6 +109,9 @@ public class ShopServiceImpl implements IShopService
public
int
updateShop
(
Shop
shop
)
{
shop
.
setUpdatedAt
(
new
Date
());
if
(
1
==
shop
.
getIsDefault
()){
shopMapper
.
updateNoDefault
();
}
return
shopMapper
.
updateShop
(
shop
);
}
...
...
soss-system/src/main/java/com/soss/system/service/impl/WechatMessageServiceImpl.java
View file @
3f6f5969
...
...
@@ -85,8 +85,11 @@ public class WechatMessageServiceImpl implements IWechatMessageService
@Override
public
int
updateWechatMessage
(
WechatMessage
wechatMessage
)
{
wechatMessage
.
setUpdatedAt
(
new
Date
());
return
wechatMessageMapper
.
updateWechatMessage
(
wechatMessage
);
WechatMessage
update
=
new
WechatMessage
();
update
.
setId
(
wechatMessage
.
getId
());
update
.
setUpdatedAt
(
new
Date
());
update
.
setState
(
"2"
);
return
wechatMessageMapper
.
updateWechatMessage
(
update
);
}
/**
...
...
soss-system/src/main/resources/mapper/system/OrderMapper.xml
View file @
3f6f5969
...
...
@@ -181,18 +181,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
<if
test=
"createAtStart!=null "
>
<![CDATA[ and create
_at >= to_date(#{createAtStart,jdbcType=DATE},'yyyy-MM-dd hh24:mi:ss')
]]>
<![CDATA[ and create
d_at >= #{createAtStart}
]]>
</if>
<if
test=
"createAtEnd!=null "
>
<![CDATA[ and create
_at <= to_date(#{createAtEnd,jdbcType=DATE},'yyyy-MM-dd hh24:mi:ss')
]]>
<![CDATA[ and create
d_at <= #{createAtEnd}
]]>
</if>
<if
test=
"payAtStart!=null "
>
<![CDATA[ and pay_time >=
to_date(#{payAtStart,jdbcType=DATE},'yyyy-MM-dd hh24:mi:ss')
]]>
<![CDATA[ and pay_time >=
#{payAtStarts}
]]>
</if>
<if
test=
"payAtEnd!=null "
>
<![CDATA[ and pay_time <=
to_date(#{payAtEnd,jdbcType=DATE},'yyyy-MM-dd hh24:mi:ss')
]]>
<![CDATA[ and pay_time <=
#{payAtEnd}
]]>
</if>
</where>
order by created_at desc
...
...
@@ -235,4 +235,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by created_at desc
</select>
<select
id=
"selectOrderByShopId"
resultMap=
"OrderResult"
>
<include
refid=
"selectOrderVo"
/>
<where>
state in
<foreach
item=
"item"
index=
"index"
collection=
"status"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
and shop_id = #{shopId}
</where>
</select>
</mapper>
\ No newline at end of file
soss-system/src/main/resources/mapper/system/ShopMapper.xml
View file @
3f6f5969
...
...
@@ -123,4 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<update
id=
"updateNoDefault"
>
update shop set is_default = 0
</update>
</mapper>
\ No newline at end of file
soss-system/src/main/resources/mapper/system/SysMenuMapper.xml
View file @
3f6f5969
...
...
@@ -80,7 +80,7 @@
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role ro on ur.role_id = ro.role_id
left join sys_user u on ur.user_id = u.user_id
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
where u.user_id = #{userId} and m.menu_type in ('M', 'C'
,'F'
) and m.status = 0 AND ro.status = 0
order by m.parent_id, m.order_num
</select>
...
...
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