xuhy
2023-05-16 f4d52e83eb99233c895a0fff0eef287792130752
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgentController.java
@@ -5,6 +5,7 @@
import com.stylefeng.guns.core.base.tips.SuccessTip;
import com.stylefeng.guns.core.exception.GunsException;
import com.stylefeng.guns.core.exception.ServiceExceptionEnum;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.util.DateUtil;
import com.stylefeng.guns.modular.system.controller.resp.TAgentResp;
import com.stylefeng.guns.modular.system.controller.util.ExcelUtil;
@@ -69,7 +70,8 @@
     * 跳转到首页
     */
    @RequestMapping("")
    public String index() {
    public String index(Model model) {
        model.addAttribute("userType", Objects.requireNonNull(ShiroKit.getUser()).getRoleType());
        return PREFIX + "tAgent.html";
    }
@@ -135,8 +137,8 @@
     */
    @RequestMapping(value = "/list")
    @ResponseBody
    public Object list(String principal,String principalPhone,String createTime) {
        EntityWrapper<TAgent> wrapper = tAgentService.getAgentWrapper(principal,principalPhone,createTime);
    public Object list(String principal,String principalPhone,String createTime,Integer status) {
        EntityWrapper<TAgent> wrapper = tAgentService.getAgentWrapper(principal,principalPhone,createTime,status);
        List<TAgent> tAgents = tAgentService.selectList(wrapper);
        // 代理商列表数据封装(导出共用)
        return tAgentService.getAgentResp(tAgents);
@@ -231,7 +233,9 @@
                tDriver.setStatus(1);
            }
        }
        tDriverService.updateBatchById(list);
        if(!CollectionUtils.isEmpty(list)){
            tDriverService.updateBatchById(list);
        }
        return SUCCESS_TIP;
    }
@@ -281,7 +285,7 @@
    @ApiOperation(value = "导出代理商列表",notes="导出代理商列表")
    @RequestMapping(value = "/export")
    @ResponseBody
    public void export(String principal,String principalPhone,String createTime, HttpServletResponse response) {
    public void export(String principal,String principalPhone,Integer status,String createTime, HttpServletResponse response) {
        try {
            Date date = new Date();
            DateFormat format = new SimpleDateFormat("yyyyMMdd");
@@ -289,7 +293,7 @@
            String fileName = "Agent"+time1+".xls";
            String[] title = new String[] {"时间","姓名","联系电话","代理区域","客服电话","订单数量",
                    "有效订单","已发放优惠券","已使用优惠券","累计优惠券金额","司机充值","司机数","状态"};
            EntityWrapper<TAgent> wrapper = tAgentService.getAgentWrapper(principal,principalPhone,createTime);
            EntityWrapper<TAgent> wrapper = tAgentService.getAgentWrapper(principal,principalPhone,createTime,status);
            // 是否异常
            List<TAgent> list = tAgentService.selectList(wrapper);