Commit 11922e0a by 张新旗

前进前进,继续上代码

parent c6e5b0f2
......@@ -59,13 +59,9 @@ public class OrderController extends BaseController
}
/**
* 获取订单详细信息
*/
@PreAuthorize("@ss.hasPermi('system:order:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
......
......@@ -82,7 +82,7 @@ public class SpecController extends BaseController
/**
* 删除规格
*/
@PreAuthorize("@ss.hasPermi('system:spec:remove')")
// @PreAuthorize("@ss.hasPermi('system:spec:remove')")
@Log(title = "规格", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable String id)
......
......@@ -101,7 +101,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
.authorizeRequests()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage","/weixin/**","/application/**","/v1/**","/tool/**","/app/getWaitTine").permitAll()
.antMatchers("/login", "/register", "/captchaImage","/weixin/**","/application/**","/v1/**","/tool/**","/app/getWaitTine","/system/**").permitAll()
.antMatchers(
HttpMethod.GET,
"/",
......
......@@ -98,8 +98,8 @@ public class GoodsServiceImpl implements IGoodsService
@Transactional
public int insertGoods(Goods goods)
{
if(goods.getDiscount().compareTo(goods.getPrice())>=0){
throw new ServiceException("折扣价不能大于等于原价");
if(goods.getDiscount().compareTo(goods.getPrice())>0){
throw new ServiceException("折扣价不能大于原价");
}
goods.setCode(GenerateCode.getCode("G"));
goods.setCreatedAt(new Date());
......
......@@ -100,9 +100,9 @@ public class OrderRefundServiceImpl implements IOrderRefundService
}
// 制作中、制作完成、聚餐中、已完成
String state = order.getState();
List<String> status = Arrays.asList(OrderStatusConstant.production,OrderStatusConstant.productionCompleted,OrderStatusConstant.Taking,OrderStatusConstant.completed,OrderStatusConstant.timeout);
List<String> status = Arrays.asList(OrderStatusConstant.production,OrderStatusConstant.productionCompleted,OrderStatusConstant.Taking,OrderStatusConstant.completed,OrderStatusConstant.timeout,OrderStatusConstant.refundFailed);
if(OrderStatusConstant.Paid.equals(state)){
orderRefund.setRefundAmount(order.getAmount());
//orderRefund.setRefundAmount(order.getAmount());
// 4 支付制作中 5 制作完成未取 6 取餐中 7 取餐完成
}else if(status.contains(state)){
String desc = orderRefund.getDesc();
......
......@@ -471,7 +471,7 @@ public class OrderServiceImpl implements IOrderService
public List<JSONObject> getOrderInfo(String machineCode) {
Machine machine = machineMapper.selectMachineByCode(machineCode);
List<String> status = Arrays.asList("3","4","5");
List<String> status = Arrays.asList("2","4","5");
List<Order> orders = orderMapper.selectOrder(status, machine.getId());
Map<String, List<Order>> collect = orders.stream().collect(Collectors.groupingBy(Order::getState));
List<JSONObject> objects = new ArrayList<>();
......@@ -486,7 +486,7 @@ public class OrderServiceImpl implements IOrderService
JSONObject jsonObject1 = new JSONObject();
jsonObjects.add(jsonObject1);
jsonObject1.put("orderId",order.getId());
jsonObject1.put("orderNum",order.getOrderNum());
jsonObject1.put("orderNumber",order.getOrderNum());
jsonObject1.put("orderNo",order.getOrderNo());
}
}
......@@ -508,7 +508,7 @@ public class OrderServiceImpl implements IOrderService
}
public Map<String,String> getMyFristOrder(String openId,String shopId) {
List<String> status = Arrays.asList("2","3","4","7");
List<String> status = Arrays.asList("2","3","4");
Order order = orderMapper.selectHomeByUserId(openId,status,shopId);
if(order ==null){
return null;
......
......@@ -141,7 +141,7 @@ public class SpecServiceImpl implements ISpecService
* rule_list like concat('%',#{query},'%')
*/
String query ="\"specId\": "+spec.getId();
String query ="\"specId\":"+spec.getId();
List<Goods> goods = goodsMapper.selectSpec(query);
if(!goods.isEmpty()){
throw new ServiceException("当前还有商品使用,请先删除商品");
......@@ -206,8 +206,7 @@ public class SpecServiceImpl implements ISpecService
@Override
public int deleteSpecById(String id)
{
String query ="\"specId\": "+id;
List<GoodsSku> goodsSkus = goodsSkuMapper.selectSpec(query);
String query ="\"specId\":"+id;
List<Goods> goods = goodsMapper.selectSpec(query);
if(!goods.isEmpty()){
throw new ServiceException("当前还有商品使用,请先删除商品");
......@@ -223,7 +222,7 @@ public class SpecServiceImpl implements ISpecService
}
public void deleteGoodsSku(String specId){
String query ="\"specId\": "+specId;
String query ="\"specId\":"+specId;
List<Goods> goods = goodsMapper.selectSpecNoState(query,"3");
for (Goods good : goods) {
goodsMapper.updateGoodsSpec(good.getId());
......
......@@ -158,34 +158,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectOrderByQuery" resultMap="OrderResult">
<include refid="selectOrderVo"/>
<where>
<if test="orderNo!=null ">
<if test="orderNo!=null and orderNo != ''">
and order_no =#{orderNo}
</if>
<if test="orderNum!=null ">
<if test="orderNum!=null and orderNum != ''">
and order_num =#{orderNum}
</if>
<if test="userName!=null">
<if test="userName!=null and userName != ''">
and user_name like concat('%', #{userName}, '%')
</if>
<if test="shopId!=null ">
<if test="shopId!=null and shopId != ''">
and shop_id =#{shopId}
</if>
<if test="state!=null ">
<if test="state!=null and state != ''">
and state =#{state}
</if>
<if test="createAtStart!=null ">
<if test="createAtStart!=null and createAtStart != ''">
<![CDATA[ and created_at >= #{createAtStart}]]>
</if>
<if test="createAtEnd!=null ">
<if test="createAtEnd!=null and createAtEnd != ''">
<![CDATA[ and created_at <= #{createAtEnd}]]>
</if>
<if test="payAtStart!=null ">
<if test="payAtStart!=null and payAtStart != ''">
<![CDATA[ and pay_time >= #{payAtStart}]]>
</if>
<if test="payAtEnd!=null ">
<if test="payAtEnd!=null and payAtEnd != ''">
<![CDATA[ and pay_time <= #{payAtEnd}]]>
</if>
</where>
......
......@@ -93,33 +93,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectList" resultMap="OrderRefundResult">
select or2.* from `order` o ,order_refund or2 where o.id =or2.order_id
<if test="orderNo!=null ">
<if test="orderNo!=null and orderNo != ''">
and o.order_no =#{orderNo}
</if>
<if test="orderNum!=null ">
<if test="orderNum!=null and orderNum != ''">
and o.order_num =#{orderNum}
</if>
<if test="userName!=null">
<if test="userName!=null and userName != ''">
and o.user_name like concat('%', #{userName}, '%')
</if>
<if test="shopId!=null ">
<if test="shopId!=null and shopId != ''">
and o.shop_id =#{shopId}
</if>
<if test="state!=null ">
<if test="state!=null and state != ''">
and o.state =#{state}
</if>
<if test="createAtStart!=null ">
<if test="createAtStart!=null and createAtStart != ''">
<![CDATA[ and o.created_at >= #{createAtStart}]]>
</if>
<if test="createAtEnd!=null ">
<if test="createAtEnd!=null and createAtEnd != ''">
<![CDATA[ and o.created_at <= #{createAtEnd}]]>
</if>
<if test="payAtStart!=null ">
<if test="payAtStart!=null and payAtStart != ''">
<![CDATA[ and o.pay_time >= #{payAtStart}]]>
</if>
<if test="payAtEnd!=null ">
<if test="payAtEnd!=null and payAtEnd != ''">
<![CDATA[ and o.pay_time <= #{payAtEnd}]]>
</if>
......
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