xuhy
2023-06-14 17f18c3d56a70327874aa7dda0adfa2f5e3dafce
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TBillController.java
@@ -6,11 +6,14 @@
import com.stylefeng.guns.modular.system.controller.util.ExcelUtil;
import com.stylefeng.guns.modular.system.enums.TBillStateEnum;
import com.stylefeng.guns.modular.system.model.TDriver;
import com.stylefeng.guns.modular.system.model.TOrder;
import com.stylefeng.guns.modular.system.service.ITOrderService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -45,6 +48,8 @@
    @Autowired
    private ITBillService tBillService;
    @Autowired
    private ITOrderService tOrderService;
    /**
     * 跳转到首页
@@ -79,12 +84,13 @@
    @RequestMapping(value = "/list")
    @ResponseBody
    public Object list(String createTime,String addresseePhone,Integer state,Integer billType,Integer billHeaderType) {
        EntityWrapper<TBill> wrapper = tBillService.getPageListWrapper(createTime,addresseePhone,state,billType,billHeaderType);
        return tBillService.selectList(wrapper);
//        EntityWrapper<TBill> wrapper = tBillService.getPageListWrapper(createTime,addresseePhone,state,billType,billHeaderType);
//        return tBillService.selectList(wrapper);
        return tBillService.getPageList(createTime,addresseePhone,state,billType,billHeaderType);
    }
    /**
     * 详情
     * 确认通过发票
     */
    @RequestMapping(value = "/confirm")
    @ResponseBody
@@ -96,7 +102,7 @@
    }
    /**
     * 详情
     * 开通发票失败
     */
    @RequestMapping(value = "/cancel")
    @ResponseBody
@@ -104,6 +110,11 @@
        TBill tBill = tBillService.selectById(tBillId);
        tBill.setState(TBillStateEnum.FAIL_BILL.getCode());
        tBillService.updateById(tBill);
        TOrder tOrder = tOrderService.selectById(tBill.getOrderId());
        if(Objects.nonNull(tOrder)){
            tOrder.setIsInvoice(0);
            tOrderService.updateById(tOrder);
        }
        return SUCCESS_TIP;
    }