wang-hao-jie
2021-12-10 96750e073321368fc6becf948d70aadee14f8030
违章记录
4个文件已修改
1个文件已添加
1个文件已删除
126 ■■■■■ 已修改文件
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/CarScheduleImpl.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPc2ScheduleImpl.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderTaskService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderTaskServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java
@@ -105,7 +105,11 @@
        QueryWrapper<Fingerprint> wrapper = new QueryWrapper<>();
        wrapper.eq("code",code);
        wrapper.eq("area_id",c.getAreaId());
        wrapper.eq("customer_id",customerId);
        Fingerprint one = iFingerprintService.getOne(wrapper);
        if(one==null){
            return ResultUtil.error("指纹与商户不匹配");
        }
        CustomerReceive customerReceive = iCustomerReceiveService.getById(one.getCustomerReceiveId());
        return new ResultUtil<Object>().setData(customerReceive);
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/OrderTaskMapper.java
@@ -41,4 +41,8 @@
            @Result(column="num1", property="num", jdbcType = JdbcType.INTEGER),
            @Result(column="num2", property="level", jdbcType = JdbcType.INTEGER)})
    List<OrderTask> list3(String date);
    @Select("select sum(time) as time2,send_date from t_order_task where date_sub(curdate(), interval 1 month) <= date(send_date) and area_section_id=#{arg0} GROUP BY send_date")
    @Results({@Result(column="time2", property="time", jdbcType = JdbcType.INTEGER)})
    List<OrderTask> sumTime(String id);
}
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/CarScheduleImpl.java
File was deleted
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/schedulings/StatisticPc2ScheduleImpl.java
New file
@@ -0,0 +1,70 @@
package cn.exrick.xboot.your.schedulings;
import cn.exrick.xboot.your.entity.Area;
import cn.exrick.xboot.your.entity.AreaSection;
import cn.exrick.xboot.your.entity.Customer;
import cn.exrick.xboot.your.entity.OrderTask;
import cn.exrick.xboot.your.service.IAreaSectionService;
import cn.exrick.xboot.your.service.IAreaService;
import cn.exrick.xboot.your.service.ICustomerService;
import cn.exrick.xboot.your.service.IOrderTaskService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
//大屏配送分析
@Component
public class StatisticPc2ScheduleImpl {
    @Autowired
    private IAreaService iAreaService;
    @Autowired
    private IAreaSectionService iAreaSectionService;
    @Autowired
    private ICustomerService iCustomerService;
    @Autowired
    private IOrderTaskService iOrderTaskService;
    @Scheduled(cron="0 0 * * * ?")//每小时执行一次
    public void execute(){
        List<Area> list = iAreaService.list();
        for(Area area:list){
            QueryWrapper<Customer> wrapper = new QueryWrapper<>();
            wrapper.eq("area_id",area.getId());
            int count = iCustomerService.count(wrapper);
            area.setCustomerSum(count);
            iAreaService.saveOrUpdate(area);
        }
        List<AreaSection> list2 = iAreaSectionService.list();
        for(AreaSection areaSection:list2){
            String id = areaSection.getId();
            QueryWrapper<Customer> wrapper = new QueryWrapper<>();
            wrapper.eq("area_section_id",id);
            int count = iCustomerService.count(wrapper);
            areaSection.setCustomerNum(count);
            List<OrderTask> orderTasks = iOrderTaskService.sumTime(id);
            int sum = 0;
            List<Integer> listTime = new ArrayList<>();
            for(OrderTask orderTask:orderTasks){
                sum+=orderTask.getTime();
                listTime.add(orderTask.getTime());
            }
        }
    }
}
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/service/IOrderTaskService.java
@@ -23,4 +23,6 @@
    int countLike();
    List<OrderTask> list3(String date);
    List<OrderTask> sumTime(String id);
}
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/serviceimpl/IOrderTaskServiceImpl.java
@@ -58,4 +58,9 @@
    public List<OrderTask> list3(String date) {
        return orderTaskMapper.list3(date);
    }
    @Override
    public List<OrderTask> sumTime(String id) {
        return orderTaskMapper.sumTime(id);
    }
}