Commit 11922e0a by 张新旗

前进前进,继续上代码

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