Commit f6385ca0 by 张新旗

代码重新提交

parent 34dbac7f
# 项目相关配置
ruoyi: ruoyi:
# 名称
name: coffee name: coffee
# 版本
version: 3.8.1 version: 3.8.1
# 版权年份
copyrightYear: 2022 copyrightYear: 2022
# 实例演示开关
demoEnabled: true demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
profile: D:/ruoyi/uploadPath profile: D:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证
captchaType: math captchaType: math
# 开发环境配置
server: server:
# 服务器的HTTP端口,默认为8080 port: 8090
port: 8080
servlet: servlet:
# 应用的访问路径
context-path: / context-path: /
tomcat: tomcat:
# tomcat的URI编码
uri-encoding: UTF-8 uri-encoding: UTF-8
# 连接数满后的排队数,默认为100
accept-count: 1000 accept-count: 1000
threads: threads:
# tomcat最大线程数,默认为200
max: 800 max: 800
# Tomcat启动初始化的线程数,默认值10
min-spare: 100 min-spare: 100
# 日志配置
logging: logging:
level: level:
com.soss: debug com.soss: debug
org.springframework: warn org.springframework: warn
# Spring配置
spring: spring:
# 资源信息
messages: messages:
# 国际化资源文件路径
basename: i18n/messages basename: i18n/messages
profiles: profiles:
active: druid active: druid
# 文件上传
servlet: servlet:
multipart: multipart:
# 单个文件大小
max-file-size: 10MB max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB max-request-size: 20MB
# 服务模块
devtools: devtools:
restart: restart:
# 热部署开关
enabled: true enabled: true
# redis 配置
redis: redis:
# 地址
host: 140.143.224.240 host: 140.143.224.240
# 端口,默认为6379
port: 6399 port: 6399
# 数据库索引
database: 0 database: 0
# 密码
password: Qwer_1234 password: Qwer_1234
# 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
pool: pool:
# 连接池中的最小空闲连接
min-idle: 0 min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8 max-idle: 8
# 连接池的最大数据库连接数
max-active: 8 max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms max-wait: -1ms
# token配置
token: token:
# 令牌自定义标识
header: Authorization header: Authorization
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期(默认30分钟)
expireTime: 30 expireTime: 30
# MyBatis配置
mybatis: mybatis:
# 搜索指定包别名
typeAliasesPackage: com.soss.**.domain typeAliasesPackage: com.soss.**.domain
# 配置mapper的扫描,找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件
pagehelper: pagehelper:
helperDialect: mysql helperDialect: mysql
supportMethodsArguments: true supportMethodsArguments: true
params: count=countSql params: count=countSql
# Swagger配置
swagger: swagger:
# 是否开启swagger
enabled: true enabled: true
# 请求前缀
pathMapping: /dev-api pathMapping: /dev-api
# 防止XSS攻击
xss: xss:
# 过滤开关
enabled: true enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/* urlPatterns: /system/*,/monitor/*,/tool/*
oss: oss:
dir: hooloo dir: hooloo
...@@ -131,11 +81,8 @@ weixin: ...@@ -131,11 +81,8 @@ weixin:
appid: wx71aa3662dfd3227d appid: wx71aa3662dfd3227d
secret: da8a0b08436dd3ce560be429f14e768a secret: da8a0b08436dd3ce560be429f14e768a
mchid: 1625511257 mchid: 1625511257
#商户支付密钥
key: WcCsQZXavaPXQEKuTGJlGOkzzTPxTPsr key: WcCsQZXavaPXQEKuTGJlGOkzzTPxTPsr
#微信回调地址
notify-url: http://114.115.234.81:8080/weixin/native/notify notify-url: http://114.115.234.81:8080/weixin/native/notify
#交易类型
trade-type: JSAPI trade-type: JSAPI
url: https://api.mch.weixin.qq.com/pay/unifiedorder url: https://api.mch.weixin.qq.com/pay/unifiedorder
query-url: https://api.mch.weixin.qq.com/pay/orderquery query-url: https://api.mch.weixin.qq.com/pay/orderquery
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration> <configuration>
<!-- 日志存放路径 --> <!-- 日志存放路径 -->
<property name="log.path" value="/home/ruoyi/logs" /> <property name="log.path" value="./logs" />
<!-- 日志输出格式 --> <!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
......
...@@ -21,7 +21,7 @@ public class Order implements Serializable ...@@ -21,7 +21,7 @@ public class Order implements Serializable
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键 */ /** 主键 */
private long id; private Long id;
/** 订单号 */ /** 订单号 */
@Excel(name = "订单号") @Excel(name = "订单号")
...@@ -44,12 +44,12 @@ public class Order implements Serializable ...@@ -44,12 +44,12 @@ public class Order implements Serializable
private String userPhone; private String userPhone;
/** 支付时间 */ /** 支付时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date payTime; private Date payTime;
/** 完成时间 */ /** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date finishTime; private Date finishTime;
...@@ -75,18 +75,18 @@ public class Order implements Serializable ...@@ -75,18 +75,18 @@ public class Order implements Serializable
/** 点单屏序号 */ /** 点单屏序号 */
@Excel(name = "点单屏序号") @Excel(name = "点单屏序号")
private String source; private Integer source;
@Excel(name = "订单状态 0 未支付取消 1 未支付 2 已支付 3 待制作 4 支付制作中 5 制作完成未取 6 取餐中 7 取餐完成 8 支付后制作前取消 9 制作中取消 10 制作完成取消 11 已退款 12 部分退款 50 其他人工干预状态") @Excel(name = "订单状态 0 未支付取消 1 未支付 2 已支付 3 待制作 4 支付制作中 5 制作完成未取 6 取餐中 7 取餐完成 8 支付后制作前取消 9 制作中取消 10 制作完成取消 11 已退款 12 部分退款 50 其他人工干预状态")
private String state; private String state;
/** 创建时间 */ /** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date createdAt; private Date createdAt;
/** 更新时间 */ /** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updatedAt; private Date updatedAt;
...@@ -110,11 +110,11 @@ public class Order implements Serializable ...@@ -110,11 +110,11 @@ public class Order implements Serializable
this.orderDetails = orderDetails; this.orderDetails = orderDetails;
} }
public long getId() { public Long getId() {
return id; return id;
} }
public void setId(long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
...@@ -226,12 +226,12 @@ public class Order implements Serializable ...@@ -226,12 +226,12 @@ public class Order implements Serializable
{ {
return machineId; return machineId;
} }
public void setSource(String source) public void setSource(Integer source)
{ {
this.source = source; this.source = source;
} }
public String getSource() public Integer getSource()
{ {
return source; return source;
} }
......
...@@ -18,6 +18,7 @@ import org.springframework.http.ResponseEntity; ...@@ -18,6 +18,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -40,6 +41,9 @@ public class MachineApiServiceImpl { ...@@ -40,6 +41,9 @@ public class MachineApiServiceImpl {
private MachineMapper machineMapper; private MachineMapper machineMapper;
@Autowired @Autowired
private StringRedisTemplate stringRedisTemplate; private StringRedisTemplate stringRedisTemplate;
@Autowired
private GoodsMapper goodsMapper;
public String shopGoodsUpdate(JSONObject jsonObject) { public String shopGoodsUpdate(JSONObject jsonObject) {
String shopID = jsonObject.getString("shopId"); String shopID = jsonObject.getString("shopId");
String skuIDs = jsonObject.getString("skuId"); String skuIDs = jsonObject.getString("skuId");
...@@ -89,10 +93,33 @@ public class MachineApiServiceImpl { ...@@ -89,10 +93,33 @@ public class MachineApiServiceImpl {
OrderDetail orderDetail =new OrderDetail(); OrderDetail orderDetail =new OrderDetail();
orderDetail.setOrderId(order.getId()); orderDetail.setOrderId(order.getId());
List<OrderDetail> orderDetails = orderDetailMapper.selectOrderDetailList(orderDetail); List<OrderDetail> orderDetails = orderDetailMapper.selectOrderDetailList(orderDetail);
order.setOrderDetails(orderDetails); for (OrderDetail detail : orderDetails) {
Goods goods = goodsMapper.selectGoodsById(detail.getGoodsId());
detail.setGoods(goods);
}
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
String orderInfo = objectMapper.writeValueAsString(order); String orderInfo = objectMapper.writeValueAsString(order);
ResultVo resultVo =sendRequest(orderInfo,"/v1/order"); JSONObject orderJson = JSONObject.parseObject(orderInfo);
// orderJson.put("goodsNum",1);
orderJson.put("machineId",orderJson.getLong("machineId"));
orderJson.put("shopId",orderJson.getLong("shopId"));
orderJson.put("state",orderJson.getLong("state"));
List<JSONObject> goodsList =new ArrayList<>();
orderJson.put("goodsList",goodsList);
for (OrderDetail detail : orderDetails) {
JSONObject jsonObject = new JSONObject();
goodsList.add(jsonObject);
jsonObject.put("goodsId", Long.valueOf(detail.getGoodsId()));
jsonObject.put("goodsName",detail.getGoodsName());
jsonObject.put("num",Integer.parseInt(detail.getNum()));
jsonObject.put("amount",detail.getAmount());
jsonObject.put("specRuleDetail",detail.getSpecRuleDetail());
jsonObject.put("specRuleIds",detail.getSpecRuleIds());
jsonObject.put("skuId",Long.parseLong(detail.getSkuId()));
jsonObject.put("goodsCategory",detail.getGoods().getCategoryName());
}
ResultVo resultVo =sendRequest(orderJson.toJSONString(),"/v1/order");
String code = resultVo.getCode(); String code = resultVo.getCode();
if("2001".equals(code)){ if("2001".equals(code)){
......
...@@ -242,12 +242,12 @@ public class OrderServiceImpl implements IOrderService ...@@ -242,12 +242,12 @@ public class OrderServiceImpl implements IOrderService
return key+String.format("%03d",andIncrement); return key+String.format("%03d",andIncrement);
} }
//获取订单号 //获取订单号
private String getOrderNo(String source){ private String getOrderNo(Integer source){
String channel = "M"; String channel = "M";
if(StringUtils.isNotEmpty(source)){ if(source !=null){
if("1".equals(source)){ if(source == 1){
channel="A"; channel="A";
}else if("2".equals(source)){ }else if(source ==2){
channel="B"; channel="B";
} }
} }
......
...@@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updatedAt" column="updated_at" /> <result property="updatedAt" column="updated_at" />
<result property="code" column="code" /> <result property="code" column="code" />
<result property="shelfAt" column="shelf_at"/> <result property="shelfAt" column="shelf_at"/>
<result property="categoryName" column="categoryName"/>
</resultMap> </resultMap>
<sql id="selectGoodsVo"> <sql id="selectGoodsVo">
...@@ -44,12 +45,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -44,12 +45,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdAt != null "> and created_at = #{createdAt}</if> <if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if> <if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
<if test="code != null and code != ''"> and code = #{code}</if> <if test="code != null and code != ''"> and code = #{code}</if>
</where> </where>
</select> </select>
<select id="selectGoodsById" parameterType="String" resultMap="GoodsResult"> <select id="selectGoodsById" parameterType="String" resultMap="GoodsResult">
<include refid="selectGoodsVo"/> select
where id = #{id} g.id,
g.name,
g.category,
gc.name as categoryName,
g.price,
g.discount,
g.take_time,
g.spec,
g.pics,
g.`desc`,
g.remarks,
g.state,
g.is_deleted,
g.created_at,
g.updated_at,
g.code,
g.shelf_at
from
goods g,goods_category gc
where g.id = #{id}
and g.category =gc.id
</select> </select>
<insert id="insertGoods" parameterType="Goods" useGeneratedKeys="true" keyProperty="id"> <insert id="insertGoods" parameterType="Goods" useGeneratedKeys="true" keyProperty="id">
......
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