Commit c6bee18d by weijiguang

Merge remote-tracking branch 'origin/v2' into v2

parents d262986d 1613180b
......@@ -5,9 +5,7 @@ import com.soss.system.domain.Order;
import com.soss.system.domain.OrderOperationLog;
import com.soss.system.mapper.OrderMapper;
import com.soss.system.mapper.OrderOperationLogMapper;
import com.soss.system.service.impl.OrderServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
......@@ -18,24 +16,24 @@ import java.util.List;
public class OrderSchedule {
@Autowired
private OrderMapper orderMapper;
@Value("${timeout}")
private Integer timeout;
// @Value("${timeout}")
// private Integer timeout;
@Autowired
private OrderOperationLogMapper operationLogMapper;
@Autowired
private OrderServiceImpl orderService;
// @Autowired
// private OrderServiceImpl orderService;
@Scheduled(fixedDelay = 60*1000)
private void process() {
//orderMapper.updateTimeOut(OrderStatusConstant.productionCompleted,timeout);
List<Order> orders1 = orderMapper.selectOrderByTime(OrderStatusConstant.productionCompleted, timeout);
/*List<Order> orders1 = orderMapper.selectOrderByTime(OrderStatusConstant.productionCompleted, timeout);
if(orders1!=null &&orders1.size()>0){
for (Order order : orders1) {
order.setState(OrderStatusConstant.timeout);
order.setUpdatedAt(new Date());
orderService.updateOrder(order);
}
}
}*/
//orderMapper.updateCancel(OrderStatusConstant.Unpaid,15);
List<Order> orders = orderMapper.selectOrderByTime(OrderStatusConstant.Unpaid, 15*60);
if(orders!=null &&orders.size()>0){
......
......@@ -137,22 +137,22 @@ public class GoodsCategoryServiceImpl implements IGoodsCategoryService
int size = goodsCategories.size();
for(int i=0;i<size;i++){
GoodsCategory goodsCategory = goodsCategories.get(i);
if(id.equals(goodsCategory.getId())){
if("1".equals(pointer)){
int index = i-1;
if(index<0){
lastId =id;
}else{
lastId = goodsCategories.get(index).getId().toString();
}
}else if("2".equals(pointer)){
int index=i+1;
if(index>=size){
lastId =id;
}else{
lastId = goodsCategories.get(index).getId().toString();
}
}
if (id.equals(goodsCategory.getId().toString())) {
if ("1".equals(pointer)) {
int lastIdx = i - 1;
if (lastIdx < 0) {
lastId = id;
} else {
lastId = goodsCategories.get(lastIdx).getId().toString();
}
} else if ("2".equals(pointer)) {
int lastIdx = i + 1;
if (lastIdx >= size) {
lastId = id;
} else {
lastId = goodsCategories.get(lastIdx).getId().toString();
}
}
}
}
......
......@@ -262,8 +262,6 @@ public class MachineApiServiceImpl {
}
machine.setState(status);
return machineMapper.updateMachine(machine);
}
public void updateOrder(Order order) {
......
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