xuhy
2023-03-14 52b4d8d25c348eb641fa3c0959b604f2b2e3626a
版本管理,发票管理
3个文件已修改
23个文件已添加
1894 ■■■■■ 已修改文件
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TBillController.java 212 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TEditionController.java 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UserMgrController.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TBillMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TEditionMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TBillMapper.xml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TEditionMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/enums/TBillStateEnum.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TBill.java 219 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TEdition.java 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITBillService.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITEditionService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBillServiceImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TEditionServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/webapp/WEB-INF/view/common/tags/uploadFile.tag 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/webapp/WEB-INF/view/system/tBill/tBill.html 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/webapp/WEB-INF/view/system/tBill/tBill_add.html 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/webapp/WEB-INF/view/system/tBill/tBill_edit.html 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/webapp/WEB-INF/view/system/tEdition/tEdition.html 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/webapp/WEB-INF/view/system/tEdition/tEdition_add.html 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/webapp/WEB-INF/view/system/tEdition/tEdition_edit.html 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/webapp/static/js/common/web-upload-file.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/webapp/static/modular/system/tBill/tBill.js 212 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/webapp/static/modular/system/tBill/tBill_info.js 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/webapp/static/modular/system/tEdition/tEdition.js 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/webapp/static/modular/system/tEdition/tEdition_info.js 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TBillController.java
New file
@@ -0,0 +1,212 @@
package com.stylefeng.guns.modular.system.controller.general;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.modular.system.controller.resp.TDriverResp;
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 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.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.beans.factory.annotation.Autowired;
import com.stylefeng.guns.core.log.LogObjectHolder;
import org.springframework.web.bind.annotation.RequestParam;
import com.stylefeng.guns.modular.system.model.TBill;
import com.stylefeng.guns.modular.system.service.ITBillService;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
 * 控制器
 *
 * @author fengshuonan
 * @Date 2023-03-14 15:15:19
 */
@Controller
@RequestMapping("/tBill")
public class TBillController extends BaseController {
    private String PREFIX = "/system/tBill/";
    @Autowired
    private ITBillService tBillService;
    /**
     * 跳转到首页
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "tBill.html";
    }
    /**
     * 跳转到添加
     */
    @RequestMapping("/tBill_add")
    public String tBillAdd() {
        return PREFIX + "tBill_add.html";
    }
    /**
     * 跳转到修改
     */
    @RequestMapping("/tBill_update/{tBillId}")
    public String tBillUpdate(@PathVariable Integer tBillId, Model model) {
        TBill tBill = tBillService.selectById(tBillId);
        model.addAttribute("item",tBill);
        LogObjectHolder.me().set(tBill);
        return PREFIX + "tBill_edit.html";
    }
    /**
     * 获取列表
     */
    @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);
    }
    /**
     * 详情
     */
    @RequestMapping(value = "/confirm")
    @ResponseBody
    public Object confirm(Integer tBillId) {
        TBill tBill = tBillService.selectById(tBillId);
        tBill.setState(TBillStateEnum.FINISH_BILL.getCode());
        tBillService.updateById(tBill);
        return SUCCESS_TIP;
    }
    /**
     * 详情
     */
    @RequestMapping(value = "/cancel")
    @ResponseBody
    public Object cancel(Integer tBillId) {
        TBill tBill = tBillService.selectById(tBillId);
        tBill.setState(TBillStateEnum.FAIL_BILL.getCode());
        tBillService.updateById(tBill);
        return SUCCESS_TIP;
    }
    /**
     * 获取列表
     */
    @RequestMapping(value = "/list-back")
    @ResponseBody
    public Object listBack(String condition) {
        return tBillService.selectList(null);
    }
    /**
     * 新增
     */
    @RequestMapping(value = "/add")
    @ResponseBody
    public Object add(TBill tBill) {
        tBillService.insert(tBill);
        return SUCCESS_TIP;
    }
    /**
     * 删除
     */
    @RequestMapping(value = "/delete")
    @ResponseBody
    public Object delete(@RequestParam Integer tBillId) {
        tBillService.deleteById(tBillId);
        return SUCCESS_TIP;
    }
    /**
     * 修改
     */
    @RequestMapping(value = "/update")
    @ResponseBody
    public Object update(TBill tBill) {
        tBillService.updateById(tBill);
        return SUCCESS_TIP;
    }
    /**
     * 详情
     */
    @RequestMapping(value = "/detail/{tBillId}")
    @ResponseBody
    public Object detail(@PathVariable("tBillId") Integer tBillId) {
        return tBillService.selectById(tBillId);
    }
    @ApiOperation(value = "导出发票列表",notes="导出发票列表")
    @RequestMapping(value = "/export")
    @ResponseBody
    public void export(String createTime,String addresseePhone,Integer state,Integer billType,Integer billHeaderType, HttpServletResponse response) {
        try {
            Date date = new Date();
            DateFormat format = new SimpleDateFormat("yyyyMMdd");
            String time1 = format.format(date);
            String fileName = "BillInfo"+time1+".xls";
            String[] title = new String[] {"申请时间","发票类型","抬头类型","发票抬头","公司税号","发票内容",
                    "发票金额","收件人姓名","收件人电话","收件人邮箱","开票状态"};
            EntityWrapper<TBill> wrapper = tBillService.getPageListWrapper(createTime,addresseePhone,state,billType,billHeaderType);
            List<TBill> tBills = tBillService.selectList(wrapper);
            String[][] values = new String[tBills.size()][];
            for (int i = 0; i < tBills.size(); i++) {
                TBill d = tBills.get(i);
                values[i] = new String[title.length];
                values[i][0] = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(d.getCreateTime());
                Integer billType1 = d.getBillType();
                if(1 == billType1){
                    values[i][1] = "电子发票";
                }
                Integer billHeaderType1 = d.getBillHeaderType();
                if(1 == billHeaderType1){
                    values[i][2] = "公司";
                } else if (2 == billHeaderType1) {
                    values[i][2] = "个人";
                }
                values[i][3] = d.getCompanyName();
                values[i][4] = d.getCompanyTaxNumber();
                values[i][5] = d.getBillContent();
                values[i][6] = String.valueOf(Objects.nonNull(d.getBillAmount())?d.getBillAmount(): BigDecimal.ZERO);
                values[i][7] = d.getAddresseeName();
                values[i][8] = d.getAddresseePhone();
                values[i][9] = d.getAddresseeEmail();
                Integer state1 = d.getState();
                if(1 == state1){
                    values[i][10] = "待开票";
                } else if (2 == state1) {
                    values[i][10] = "已开票";
                } else if (3 == state1) {
                    values[i][10] = "开票失败";
                }
            }
            HSSFWorkbook wb = ExcelUtil.getHSSFWorkbook("Variance"+time1, title, values, null);
            ExcelUtil.setResponseHeader(response, fileName);
            OutputStream os = response.getOutputStream();
            wb.write(os);
            os.flush();
            os.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TEditionController.java
New file
@@ -0,0 +1,128 @@
package com.stylefeng.guns.modular.system.controller.general;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.core.util.DateUtil;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.beans.factory.annotation.Autowired;
import com.stylefeng.guns.core.log.LogObjectHolder;
import org.springframework.web.bind.annotation.RequestParam;
import com.stylefeng.guns.modular.system.model.TEdition;
import com.stylefeng.guns.modular.system.service.ITEditionService;
import java.util.Date;
/**
 * 控制器
 *
 * @author fengshuonan
 * @Date 2023-03-14 09:44:02
 */
@Controller
@RequestMapping("/tEdition")
public class TEditionController extends BaseController {
    private String PREFIX = "/system/tEdition/";
    @Autowired
    private ITEditionService tEditionService;
    /**
     * 跳转到首页
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "tEdition.html";
    }
    /**
     * 跳转到添加
     */
    @RequestMapping("/tEdition_add")
    public String tEditionAdd() {
        return PREFIX + "tEdition_add.html";
    }
    /**
     * 跳转到修改
     */
    @RequestMapping("/tEdition_update/{tEditionId}")
    public String tEditionUpdate(@PathVariable Integer tEditionId, Model model) {
        TEdition tEdition = tEditionService.selectById(tEditionId);
        model.addAttribute("item",tEdition);
        LogObjectHolder.me().set(tEdition);
        return PREFIX + "tEdition_edit.html";
    }
    /**
     * 获取列表
     */
    @RequestMapping(value = "/list")
    @ResponseBody
    public Object list(String createTime,String editionNo) {
        EntityWrapper<TEdition> wrapper = new EntityWrapper<>();
        if(StringUtils.hasLength(createTime)){
            String[] split = createTime.split(" - ");
            Date startTime = DateUtil.getDate_str4(split[0]);
            Date endTime = DateUtil.getDate_str4(split[1]);
            wrapper.between("createTime",startTime,endTime);
        }
        if(StringUtils.hasLength(editionNo)){
            wrapper.like("editionNo",editionNo);
        }
        return tEditionService.selectList(wrapper);
    }
    /**
     * 获取列表
     */
    @RequestMapping(value = "/list-back")
    @ResponseBody
    public Object listBack(String condition) {
        return tEditionService.selectList(null);
    }
    /**
     * 新增
     */
    @RequestMapping(value = "/add")
    @ResponseBody
    public Object add(TEdition tEdition) {
        tEditionService.insert(tEdition);
        return SUCCESS_TIP;
    }
    /**
     * 删除
     */
    @RequestMapping(value = "/delete")
    @ResponseBody
    public Object delete(@RequestParam Integer tEditionId) {
        tEditionService.deleteById(tEditionId);
        return SUCCESS_TIP;
    }
    /**
     * 修改
     */
    @RequestMapping(value = "/update")
    @ResponseBody
    public Object update(TEdition tEdition) {
        tEditionService.updateById(tEdition);
        return SUCCESS_TIP;
    }
    /**
     * 详情
     */
    @RequestMapping(value = "/detail/{tEditionId}")
    @ResponseBody
    public Object detail(@PathVariable("tEditionId") Integer tEditionId) {
        return tEditionService.selectById(tEditionId);
    }
}
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UserMgrController.java
@@ -19,6 +19,7 @@
import com.stylefeng.guns.core.log.LogObjectHolder;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.shiro.ShiroUser;
import com.stylefeng.guns.core.util.ObsUploadUtil;
import com.stylefeng.guns.core.util.SinataUtil;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.dao.UserMapper;
@@ -29,6 +30,7 @@
import com.stylefeng.guns.modular.system.service.ITDriverService;
import com.stylefeng.guns.modular.system.service.IUserService;
import com.stylefeng.guns.modular.system.transfer.UserDto;
import com.stylefeng.guns.modular.system.util.OssUploadUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -37,12 +39,10 @@
import org.springframework.web.multipart.MultipartFile;
import javax.naming.NoPermissionException;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.io.File;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
/**
 * 系统管理员控制器
@@ -431,6 +431,28 @@
        return pictureName;
    }
    @ResponseBody
    @RequestMapping("/saveApk")
    public String saveApk(@RequestPart("myfile") MultipartFile file, HttpServletRequest request){
        Map<String, Object> m = new HashMap<>();
        try {
            String pictureName = UUID.randomUUID().toString() + "." + ToolUtil.getFileSuffix(file.getOriginalFilename());
            try {
                String fileSavePath = gunsProperties.getFileUploadPath()+"apk\\";
                String s = OssUploadUtil.ossUpload(request, file);
                // file.transferTo(new File(fileSavePath + pictureName));
                return s;
            } catch (Exception e) {
                e.printStackTrace();
            }
            m.put("imgUrl", gunsProperties.getFileUploadPath()+"apk/"+pictureName);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    /**
     * 判断当前登录的用户是否有操作这个用户的权限
     */
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TBillMapper.java
New file
@@ -0,0 +1,16 @@
package com.stylefeng.guns.modular.system.dao;
import com.stylefeng.guns.modular.system.model.TBill;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
 * <p>
 * 发票管理 Mapper 接口
 * </p>
 *
 * @author stylefeng
 * @since 2023-03-14
 */
public interface TBillMapper extends BaseMapper<TBill> {
}
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TEditionMapper.java
New file
@@ -0,0 +1,16 @@
package com.stylefeng.guns.modular.system.dao;
import com.stylefeng.guns.modular.system.model.TEdition;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
 * <p>
 * 版本管理 Mapper 接口
 * </p>
 *
 * @author stylefeng
 * @since 2023-03-14
 */
public interface TEditionMapper extends BaseMapper<TEdition> {
}
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TBillMapper.xml
New file
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.stylefeng.guns.modular.system.dao.TBillMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TBill">
        <id column="id" property="id" />
        <result column="orderId" property="orderId" />
        <result column="billType" property="billType" />
        <result column="billHeaderType" property="billHeaderType" />
        <result column="companyName" property="companyName" />
        <result column="companyTaxNumber" property="companyTaxNumber" />
        <result column="billContent" property="billContent" />
        <result column="moreContent" property="moreContent" />
        <result column="billAmount" property="billAmount" />
        <result column="addresseeName" property="addresseeName" />
        <result column="addresseePhone" property="addresseePhone" />
        <result column="addresseeEmail" property="addresseeEmail" />
        <result column="state" property="state" />
        <result column="createTime" property="createTime" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, orderId, billType, billHeaderType, companyName, companyTaxNumber, billContent, moreContent, billAmount, addresseeName, addresseePhone, addresseeEmail, state, createTime
    </sql>
</mapper>
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TEditionMapper.xml
New file
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.stylefeng.guns.modular.system.dao.TEditionMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TEdition">
        <id column="id" property="id" />
        <result column="editionNo" property="editionNo" />
        <result column="editionFile" property="editionFile" />
        <result column="editionAnnouncement" property="editionAnnouncement" />
        <result column="createTime" property="createTime" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, editionNo, editionFile, editionAnnouncement, createTime
    </sql>
</mapper>
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/enums/TBillStateEnum.java
New file
@@ -0,0 +1,51 @@
package com.stylefeng.guns.modular.system.enums;
/**
 * @Description 发票状态枚举
 * @Author xiaochen
 * @Date 2023/02/15 9:42
 */
public enum TBillStateEnum {
    WAIT_BILL(1, "待开票"),
    FINISH_BILL(2, "已开票"),
    FAIL_BILL(3,"开票失败");
    private String desc;
    private int code;
    TBillStateEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public String getDesc() {
        return desc;
    }
    public int getCode() {
        return code;
    }
    /**
     * 通过code获取枚举
     *
     * @param code
     * @return
     */
    public static TBillStateEnum fromCode(Integer code) {
        TBillStateEnum[] resultTypes = TBillStateEnum.values();
        for (TBillStateEnum resultType : resultTypes) {
            if (code.equals(resultType.getCode())) {
                return resultType;
            }
        }
        return null;
    }
}
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TBill.java
New file
@@ -0,0 +1,219 @@
package com.stylefeng.guns.modular.system.model;
import com.baomidou.mybatisplus.enums.IdType;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
/**
 * <p>
 * 发票管理
 * </p>
 *
 * @author stylefeng
 * @since 2023-03-14
 */
@TableName("t_bill")
public class TBill extends Model<TBill> {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 订单id
     */
    private Integer orderId;
    /**
     * 发票类型 1电子发票
     */
    private Integer billType;
    /**
     * 发票抬头 1公司 2个人
     */
    private Integer billHeaderType;
    /**
     * 公司名称/个人抬头名称
     */
    private String companyName;
    /**
     * 公司税号
     */
    private String companyTaxNumber;
    /**
     * 发票内容
     */
    private String billContent;
    /**
     * 更多内容
     */
    private String moreContent;
    /**
     * 发票金额
     */
    private BigDecimal billAmount;
    /**
     * 收件人姓名
     */
    private String addresseeName;
    /**
     * 收件人电话
     */
    private String addresseePhone;
    /**
     * 收件人邮箱
     */
    private String addresseeEmail;
    /**
     * 开票状态 1待开票 2已开票 3开票失败
     */
    private Integer state;
    /**
     * 添加时间
     */
    private Date createTime;
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public Integer getOrderId() {
        return orderId;
    }
    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }
    public Integer getBillType() {
        return billType;
    }
    public void setBillType(Integer billType) {
        this.billType = billType;
    }
    public Integer getBillHeaderType() {
        return billHeaderType;
    }
    public void setBillHeaderType(Integer billHeaderType) {
        this.billHeaderType = billHeaderType;
    }
    public String getCompanyName() {
        return companyName;
    }
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
    public String getCompanyTaxNumber() {
        return companyTaxNumber;
    }
    public void setCompanyTaxNumber(String companyTaxNumber) {
        this.companyTaxNumber = companyTaxNumber;
    }
    public String getBillContent() {
        return billContent;
    }
    public void setBillContent(String billContent) {
        this.billContent = billContent;
    }
    public String getMoreContent() {
        return moreContent;
    }
    public void setMoreContent(String moreContent) {
        this.moreContent = moreContent;
    }
    public BigDecimal getBillAmount() {
        return billAmount;
    }
    public void setBillAmount(BigDecimal billAmount) {
        this.billAmount = billAmount;
    }
    public String getAddresseeName() {
        return addresseeName;
    }
    public void setAddresseeName(String addresseeName) {
        this.addresseeName = addresseeName;
    }
    public String getAddresseePhone() {
        return addresseePhone;
    }
    public void setAddresseePhone(String addresseePhone) {
        this.addresseePhone = addresseePhone;
    }
    public String getAddresseeEmail() {
        return addresseeEmail;
    }
    public void setAddresseeEmail(String addresseeEmail) {
        this.addresseeEmail = addresseeEmail;
    }
    public Integer getState() {
        return state;
    }
    public void setState(Integer state) {
        this.state = state;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Override
    protected Serializable pkVal() {
        return this.id;
    }
    @Override
    public String toString() {
        return "TBill{" +
        "id=" + id +
        ", orderId=" + orderId +
        ", billType=" + billType +
        ", billHeaderType=" + billHeaderType +
        ", companyName=" + companyName +
        ", companyTaxNumber=" + companyTaxNumber +
        ", billContent=" + billContent +
        ", moreContent=" + moreContent +
        ", billAmount=" + billAmount +
        ", addresseeName=" + addresseeName +
        ", addresseePhone=" + addresseePhone +
        ", addresseeEmail=" + addresseeEmail +
        ", state=" + state +
        ", createTime=" + createTime +
        "}";
    }
}
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TEdition.java
New file
@@ -0,0 +1,112 @@
package com.stylefeng.guns.modular.system.model;
import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
/**
 * <p>
 * 版本管理
 * </p>
 *
 * @author stylefeng
 * @since 2023-03-14
 */
@TableName("t_edition")
public class TEdition extends Model<TEdition> {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 版本编号
     */
    private String editionNo;
    /**
     * 版本文件
     */
    private String editionFile;
    /**
     * 版本公告
     */
    private String editionAnnouncement;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 端口 1用户端 2司机端
     */
    private Integer editionPort;
    public Integer getEditionPort() {
        return editionPort;
    }
    public void setEditionPort(Integer editionPort) {
        this.editionPort = editionPort;
    }
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getEditionNo() {
        return editionNo;
    }
    public void setEditionNo(String editionNo) {
        this.editionNo = editionNo;
    }
    public String getEditionFile() {
        return editionFile;
    }
    public void setEditionFile(String editionFile) {
        this.editionFile = editionFile;
    }
    public String getEditionAnnouncement() {
        return editionAnnouncement;
    }
    public void setEditionAnnouncement(String editionAnnouncement) {
        this.editionAnnouncement = editionAnnouncement;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Override
    protected Serializable pkVal() {
        return this.id;
    }
    @Override
    public String toString() {
        return "TEdition{" +
        "id=" + id +
        ", editionNo=" + editionNo +
        ", editionFile=" + editionFile +
        ", editionAnnouncement=" + editionAnnouncement +
        ", createTime=" + createTime +
        "}";
    }
}
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITBillService.java
New file
@@ -0,0 +1,28 @@
package com.stylefeng.guns.modular.system.service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.modular.system.model.TBill;
import com.baomidou.mybatisplus.service.IService;
/**
 * <p>
 * 发票管理 服务类
 * </p>
 *
 * @author stylefeng
 * @since 2023-03-14
 */
public interface ITBillService extends IService<TBill> {
    /**
     * 获取发票wrapper
     * @param createTime
     * @param addresseePhone
     * @param state
     * @param billType
     * @param billHeaderType
     * @return
     */
    EntityWrapper<TBill> getPageListWrapper(String createTime, String addresseePhone, Integer state, Integer billType, Integer billHeaderType);
}
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITEditionService.java
New file
@@ -0,0 +1,16 @@
package com.stylefeng.guns.modular.system.service;
import com.stylefeng.guns.modular.system.model.TEdition;
import com.baomidou.mybatisplus.service.IService;
/**
 * <p>
 * 版本管理 服务类
 * </p>
 *
 * @author stylefeng
 * @since 2023-03-14
 */
public interface ITEditionService extends IService<TEdition> {
}
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBillServiceImpl.java
New file
@@ -0,0 +1,50 @@
package com.stylefeng.guns.modular.system.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.util.DateUtil;
import com.stylefeng.guns.modular.system.model.TBill;
import com.stylefeng.guns.modular.system.dao.TBillMapper;
import com.stylefeng.guns.modular.system.service.ITBillService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.Date;
import java.util.Objects;
/**
 * <p>
 * 发票管理 服务实现类
 * </p>
 *
 * @author stylefeng
 * @since 2023-03-14
 */
@Service
public class TBillServiceImpl extends ServiceImpl<TBillMapper, TBill> implements ITBillService {
    @Override
    public EntityWrapper<TBill> getPageListWrapper(String createTime, String addresseePhone, Integer state, Integer billType, Integer billHeaderType) {
        EntityWrapper<TBill> wrapper = new EntityWrapper<>();
        if(StringUtils.hasLength(createTime)){
            String[] split = createTime.split(" - ");
            Date startTime = DateUtil.getDate_str4(split[0]);
            Date endTime = DateUtil.getDate_str4(split[1]);
            wrapper.between("createTime",startTime,endTime);
        }
        if(StringUtils.hasLength(addresseePhone)){
            wrapper.like("addresseePhone",addresseePhone);
        }
        if(Objects.nonNull(state)){
            wrapper.eq("state",state);
        }
        if(Objects.nonNull(billType)){
            wrapper.eq("billType",billType);
        }
        if(Objects.nonNull(billHeaderType)){
            wrapper.eq("billHeaderType",billHeaderType);
        }
        return wrapper;
    }
}
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TEditionServiceImpl.java
New file
@@ -0,0 +1,20 @@
package com.stylefeng.guns.modular.system.service.impl;
import com.stylefeng.guns.modular.system.model.TEdition;
import com.stylefeng.guns.modular.system.dao.TEditionMapper;
import com.stylefeng.guns.modular.system.service.ITEditionService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
 * <p>
 * 版本管理 服务实现类
 * </p>
 *
 * @author stylefeng
 * @since 2023-03-14
 */
@Service
public class TEditionServiceImpl extends ServiceImpl<TEditionMapper, TEdition> implements ITEditionService {
}
management/guns-admin/src/main/webapp/WEB-INF/view/common/tags/uploadFile.tag
@@ -5,7 +5,7 @@
        <input type="hidden" id="${id}" name="${id}"/>
    </div>
    <div class="col-sm-2">
        <button class="btn btn-outline btn-success" type="button" onclick="UploadFileFn()"><i class="fa fa-upload"></i>上传文件</button>
        <button class="btn btn-outline btn-success" type="button" onclick="TEdition.previewFile()"><i class="fa fa-upload"></i>上传文件</button>
    </div>
</div>
<div class="col-sm-12 progress progress-striped" style="margin-top: 10px;">
management/guns-admin/src/main/webapp/WEB-INF/view/system/tBill/tBill.html
New file
@@ -0,0 +1,75 @@
@layout("/common/_container.html"){
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>管理</h5>
            </div>
            <div class="ibox-content">
                <div class="row row-lg">
                    <div class="col-sm-12">
                        <div class="row">
                            <div class="col-sm-2">
                                <#TimeCon id="createTime" name="申请时间" />
                            </div>
                            <div class="col-sm-2">
                                <#NameCon id="addresseePhone" name="手机号" />
                            </div>
                            <div class="col-sm-2">
                                <select class="input-group" id="state" style="width: 180px;height: 33px" name="state">
                                    <option value="">状态</option>
                                    <option value="1">待开票</option>
                                    <option value="2">已开票</option>
                                    <option value="3">开票失败</option>
                                </select>
                            </div>
                            <div class="col-sm-2">
                                <select class="input-group" id="billType" style="width: 180px;height: 33px" name="billType">
                                    <option value="">发票类型</option>
                                    <option value="1">电子发票</option>
                                </select>
                            </div>
                            <div class="col-sm-2">
                                <select class="input-group" id="billHeaderType" style="width: 180px;height: 33px" name="billHeaderType">
                                    <option value="">抬头类型</option>
                                    <option value="1">公司</option>
                                    <option value="2">个人</option>
                                </select>
                            </div>
                            <div class="col-sm-2">
                                <#button name="搜索" icon="fa-search" clickFun="TBill.search()"/>
                                <#button name="重置" icon="fa-trash" clickFun="TBill.resetSearch()" space="true"/>
                            </div>
                            <div class="col-sm-12">
                                <button type="button" class="btn btn-primary " onclick="TBill.export()" id="export">
                                    <i class="fa "></i>&nbsp;导出
                                </button>
                            </div>
                        </div>
                        <div class="hidden-xs" id="TBillTableToolbar" role="group">
                            @if(shiro.hasPermission("/tBill/add")){
                                <#button name="添加" icon="fa-plus" clickFun="TBill.openAddTBill()"/>
                            @}
                            @if(shiro.hasPermission("/tBill/update")){
                                <#button name="修改" icon="fa-edit" clickFun="TBill.openTBillDetail()" space="true"/>
                            @}
                            @if(shiro.hasPermission("/tBill/delete")){
                                <#button name="删除" icon="fa-remove" clickFun="TBill.delete()" space="true"/>
                            @}
                        </div>
                        <#table id="TBillTable"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/modular/system/tBill/tBill.js"></script>
<script type="text/javascript">
    laydate.render({
        elem: '#createTime',
        type: 'date',
        range: true
    });
</script>
@}
management/guns-admin/src/main/webapp/WEB-INF/view/system/tBill/tBill_add.html
New file
@@ -0,0 +1,39 @@
@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">
            <div class="row">
                <div class="col-sm-6 b-r">
                            <#input id="id" name="主键" underline="true"/>
                            <#input id="orderId" name="订单id" underline="true"/>
                            <#input id="billType" name="发票类型 1电子发票" underline="true"/>
                            <#input id="billHeaderType" name="发票抬头 1公司 2个人" underline="true"/>
                            <#input id="companyName" name="公司名称/个人抬头名称" underline="true"/>
                            <#input id="companyTaxNumber" name="公司税号" underline="true"/>
                            <#input id="billContent" name="发票内容"/>
                </div>
                <div class="col-sm-6">
                            <#input id="moreContent" name="更多内容" underline="true"/>
                            <#input id="billAmount" name="发票金额" underline="true"/>
                            <#input id="addresseeName" name="收件人姓名" underline="true"/>
                            <#input id="addresseePhone" name="收件人电话" underline="true"/>
                            <#input id="addresseeEmail" name="收件人邮箱" underline="true"/>
                            <#input id="state" name="开票状态 1代开票 2已开票 3开票失败" underline="true"/>
                            <#input id="createTime" name="添加时间" underline="true"/>
                </div>
            </div>
            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBillInfoDlg.addSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBillInfoDlg.close()"/>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/modular/system/tBill/tBill_info.js"></script>
@}
management/guns-admin/src/main/webapp/WEB-INF/view/system/tBill/tBill_edit.html
New file
@@ -0,0 +1,39 @@
@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">
            <div class="row">
                <div class="col-sm-6 b-r">
                            <#input id="id" name="主键" value="${item.id}" underline="true"/>
                            <#input id="orderId" name="订单id" value="${item.orderId}" underline="true"/>
                            <#input id="billType" name="发票类型 1电子发票" value="${item.billType}" underline="true"/>
                            <#input id="billHeaderType" name="发票抬头 1公司 2个人" value="${item.billHeaderType}" underline="true"/>
                            <#input id="companyName" name="公司名称/个人抬头名称" value="${item.companyName}" underline="true"/>
                            <#input id="companyTaxNumber" name="公司税号" value="${item.companyTaxNumber}" underline="true"/>
                            <#input id="billContent" name="发票内容" value="${item.billContent}" />
                </div>
                <div class="col-sm-6">
                            <#input id="moreContent" name="更多内容" value="${item.moreContent}" underline="true"/>
                            <#input id="billAmount" name="发票金额" value="${item.billAmount}" underline="true"/>
                            <#input id="addresseeName" name="收件人姓名" value="${item.addresseeName}" underline="true"/>
                            <#input id="addresseePhone" name="收件人电话" value="${item.addresseePhone}" underline="true"/>
                            <#input id="addresseeEmail" name="收件人邮箱" value="${item.addresseeEmail}" underline="true"/>
                            <#input id="state" name="开票状态 1代开票 2已开票 3开票失败" value="${item.state}" underline="true"/>
                            <#input id="createTime" name="添加时间" value="${item.createTime}" />
                </div>
            </div>
            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBillInfoDlg.editSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBillInfoDlg.close()"/>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/modular/system/tBill/tBill_info.js"></script>
@}
management/guns-admin/src/main/webapp/WEB-INF/view/system/tEdition/tEdition.html
New file
@@ -0,0 +1,49 @@
@layout("/common/_container.html"){
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>版本更新</h5>
            </div>
            <div class="ibox-content">
                <div class="row row-lg">
                    <div class="col-sm-12">
                        <div class="row">
                            <div class="col-sm-3">
                                <#TimeCon id="createTime" name="更新时间" />
                            </div>
                            <div class="col-sm-3">
                                <#NameCon id="editionNo" name="版本号" />
                            </div>
                            <div class="col-sm-3">
                                <#button name="搜索" icon="fa-search" clickFun="TEdition.search()"/>
                                <#button name="重置" icon="fa-trash" clickFun="TEdition.resetSearch()" space="true"/>
                            </div>
                        </div>
                        <div class="hidden-xs" id="TEditionTableToolbar" role="group">
                            @if(shiro.hasPermission("/tEdition/add")){
                                <#button name="添加" icon="fa-plus" clickFun="TEdition.openAddTEdition()"/>
                            @}
                            @if(shiro.hasPermission("/tEdition/update")){
                                <#button name="修改" icon="fa-edit" clickFun="TEdition.openTEditionDetail()" space="true"/>
                            @}
                            @if(shiro.hasPermission("/tEdition/delete")){
                                <#button name="删除" icon="fa-remove" clickFun="TEdition.delete()" space="true"/>
                            @}
                        </div>
                        <#table id="TEditionTable"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/modular/system/tEdition/tEdition.js"></script>
<script type="text/javascript">
    laydate.render({
        elem: '#createTime',
        type: 'date',
        range: true
    });
</script>
@}
management/guns-admin/src/main/webapp/WEB-INF/view/system/tEdition/tEdition_add.html
New file
@@ -0,0 +1,91 @@
@layout("/common/_container.html"){
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>版本添加</h5>
            </div>
            <div class="ibox-content" id="editionInfoForm">
                <div class="row row-lg">
                    <div class="col-sm-12">
                        <div class="col-sm-12"  style="cursor: pointer;text-align: left;">
                            <div class="initialLevel col-sm-12 control-label form-group"  >
                                <div class="initialLevel col-sm-5 control-label form-group"  >
                                    <label class="control-label  col-sm-2" >版本编号:</label>
                                    <input id="editionNo" name="editionNo" type="text" class="col-sm-3" style="width: 180px;height: 30px" required="required">
                                </div>
                            </div>
                            <div class="initialLevel col-sm-12 control-label form-group"  >
                                <div class="initialLevel col-sm-5 control-label form-group"  >
                                    <label class="control-label  col-sm-2" >端&emsp;&emsp;口:</label>
                                    <select id="editionPort" class="col-sm-3" style="width: 180px;height: 30px" name="editionPort">
                                        <option value="">请选择端口</option>
                                        <option value="1">用户端</option>
                                        <option value="2">司机端</option>
                                    </select>
                                </div>
                            </div>
                            <div class="initialLevel col-sm-12 control-label form-group"  >
                                <div class="initialLevel col-sm-6 control-label form-group"  >
                                    <label class="control-label col-sm-2" >上传apk文件:</label>
                                    <input id="upFile" type="file" onclick="TEdition.previewFile()" class="col-sm-3" style="width: 180px;height: 30px" required="required">
                                    <input hidden id="editionFile" name="editionFile">
                                </div>
                            </div>
                            <div class="initialLevel col-sm-12 control-label form-group"  >
                                <div class="initialLevel col-sm-5 control-label form-group"  >
                                    <label class="control-label  col-sm-2" >版本公告:</label>
                                    <textarea id="editionAnnouncement" name="editionAnnouncement" class="col-sm-3" style="width: 180px;height: 80px"></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row btn-group-m-t">
                    <div class="col-sm-10" style="text-align: center">
                        <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TEditionInfoDlg.close()"/>
                        <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TEditionInfoDlg.addSubmit()"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">
            <div class="row">
                <div class="col-sm-6 b-r">
                            <#input id="id" name="主键" underline="true"/>
                            <#input id="editionNo" name="版本编号" underline="true"/>
                            <#input id="editionFile" name="版本文件"/>
                </div>
                <div class="col-sm-6">
                            <#input id="editionAnnouncement" name="版本公告" underline="true"/>
                            <#input id="createTime" name="创建时间" underline="true"/>
                </div>
            </div>
            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TEditionInfoDlg.addSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TEditionInfoDlg.close()"/>
                </div>
            </div>
        </div>
    </div>
</div>-->
<script src="${ctxPath}/static/modular/system/tEdition/tEdition_info.js"></script>
<script src="${ctxPath}/static/modular/system/tEdition/tEdition.js"></script>
<script src="${ctxPath}/static/js/common/web-upload-file.js"></script>
@}
management/guns-admin/src/main/webapp/WEB-INF/view/system/tEdition/tEdition_edit.html
New file
@@ -0,0 +1,30 @@
@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">
            <div class="row">
                <div class="col-sm-6 b-r">
                            <#input id="id" name="主键" value="${item.id}" underline="true"/>
                            <#input id="editionNo" name="版本编号" value="${item.editionNo}" underline="true"/>
                            <#input id="editionFile" name="版本文件" value="${item.editionFile}" />
                </div>
                <div class="col-sm-6">
                            <#input id="editionAnnouncement" name="版本公告" value="${item.editionAnnouncement}" underline="true"/>
                            <#input id="createTime" name="创建时间" value="${item.createTime}" />
                </div>
            </div>
            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TEditionInfoDlg.editSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TEditionInfoDlg.close()"/>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/modular/system/tEdition/tEdition_info.js"></script>
@}
management/guns-admin/src/main/webapp/static/js/common/web-upload-file.js
@@ -3,6 +3,7 @@
 */
// 开始上传文件
function UploadFileFn() {
    console.log(111)
    $("#progressBarFile").html("0%").css("width", "0%");
    var upFile = $("#upFile").get(0).files[0]; //input file标签
    var formData = new FormData(); //创建FormData对象
management/guns-admin/src/main/webapp/static/modular/system/tBill/tBill.js
New file
@@ -0,0 +1,212 @@
/**
 * 管理初始化
 */
var TBill = {
    id: "TBillTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
/**
 * 初始化表格的列
 */
TBill.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'},
        {title: '订单id', field: 'orderId', visible: false, align: 'center', valign: 'middle'},
        {title: '申请时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'},
        {title: '发票类型', field: 'billType', visible: true, align: 'center', valign: 'middle',
                formatter: function (value, row) {
                    if(row.billType === 1){
                        return '<span>电子发票</span>'
                    }
                }
            },
        {title: '抬头类型', field: 'billHeaderType', visible: true, align: 'center', valign: 'middle',
                formatter: function (value, row) {
                    if(row.billHeaderType === 1){
                        return '<span>公司</span>'
                    }else if(row.billHeaderType === 2){
                        return '<span>个人</span>'
                    }
                }
            },
        {title: '发票抬头', field: 'companyName', visible: true, align: 'center', valign: 'middle'},
        {title: '公司税号', field: 'companyTaxNumber', visible: true, align: 'center', valign: 'middle'},
        {title: '发票内容', field: 'billContent', visible: true, align: 'center', valign: 'middle'},
        {title: '更多内容', field: 'moreContent', visible: false, align: 'center', valign: 'middle'},
        {title: '发票金额', field: 'billAmount', visible: true, align: 'center', valign: 'middle'},
        {title: '收件人姓名', field: 'addresseeName', visible: true, align: 'center', valign: 'middle'},
        {title: '收件人电话', field: 'addresseePhone', visible: true, align: 'center', valign: 'middle'},
        {title: '收件人邮箱', field: 'addresseeEmail', visible: true, align: 'center', valign: 'middle'},
        {title: '开票状态', field: 'state', visible: true, align: 'center', valign: 'middle',
            formatter: function (value, row) {
                if(row.state === 1){
                    return '<span>待开票</span>'
                }else if(row.state === 2){
                    return '<span>已开票</span>'
                }else if(row.state === 3){
                    return '<span>开票失败</span>'
                }
            }
        },
        {title: '操作', visible: true, align: 'center', valign: 'middle',width:150,
            formatter: function (value, row) {
                return '<a href="#" onclick="TBill.confirm('+row.id+','+row.state+')" style="color:blue">确定</a>' + '&emsp;' +
                    '<a href="#" onclick="TBill.cancel('+row.id+','+row.state+')" style="color:red">取消</a>'
            }
        }
    ];
};
/**
 * 检查是否选中
 */
TBill.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        TBill.seItem = selected[0];
        return true;
    }
};
/**
 * 点击添加
 */
TBill.openAddTBill = function () {
    var index = layer.open({
        type: 2,
        title: '添加',
        area: ['800px', '420px'], //宽高
        fix: false, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/tBill/tBill_add'
    });
    this.layerIndex = index;
};
/**
 * 打开查看详情
 */
TBill.openTBillDetail = function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '详情',
            area: ['800px', '420px'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tBill/tBill_update/' + TBill.seItem.id
        });
        this.layerIndex = index;
    }
};
/**
 * 删除
 */
TBill.delete = function () {
    if (this.check()) {
        var ajax = new $ax(Feng.ctxPath + "/tBill/delete", function (data) {
            Feng.success("删除成功!");
            TBill.table.refresh();
        }, function (data) {
            Feng.error("删除失败!" + data.responseJSON.message + "!");
        });
        ajax.set("tBillId",this.seItem.id);
        ajax.start();
    }
};
/**
 * 确认通过发票
 */
TBill.confirm = function (id,state) {
    if(1 !== state){
        Feng.error("该条数据已审核");
        return;
    }
    var ajax = new $ax(Feng.ctxPath + "/tBill/confirm", function (data) {
        Feng.success("操作成功!");
        TBill.table.refresh();
    }, function (data) {
        Feng.error("操作失败!" + data.responseJSON.message + "!");
    });
    ajax.set("tBillId",id);
    ajax.start();
};
/**
 * 发票失败
 */
TBill.cancel = function (id,state) {
    if(1 !== state){
        Feng.error("该条数据已审核");
        return;
    }
    var ajax = new $ax(Feng.ctxPath + "/tBill/cancel", function (data) {
        Feng.success("操作成功!");
        TBill.table.refresh();
    }, function (data) {
        Feng.error("操作失败!" + data.responseJSON.message + "!");
    });
    ajax.set("tBillId",id);
    ajax.start();
};
/**
 * 发票信息导出
 */
TBill.export=function(){
    var createTime=$("#createTime").val()
    var addresseePhone=$("#addresseePhone").val()
    var state=$("#state").val()
    var billType=$("#billType").val()
    var billHeaderType=$("#billHeaderType").val()
    window.location.href=Feng.ctxPath + "/tBill/export?createTime="+createTime
        +"&addresseePhone="+addresseePhone
        +"&state="+state
        +"&billType="+billType
        +"&billHeaderType="+billHeaderType
    ;
}
/**
 * 查询列表
 */
TBill.search = function () {
    var queryData = {};
    queryData['createTime'] = $("#createTime").val();
    queryData['addresseePhone'] = $("#addresseePhone").val();
    queryData['state'] = $("#state").val();
    queryData['billType'] = $("#billType").val();
    queryData['billHeaderType'] = $("#billHeaderType").val();
    TBill.table.refresh({query: queryData});
};
/**
 * 重置
 */
TBill.resetSearch = function (){
    $("#createTime").val('');
    $("#addresseePhone").val('');
    $("#state").val('');
    $("#billType").val('');
    $("#billHeaderType").val('');
    TBill.search();
}
$(function () {
    var defaultColunms = TBill.initColumn();
    var table = new BSTable(TBill.id, "/tBill/list", defaultColunms);
    table.setPaginationType("client");
    TBill.table = table.init();
});
management/guns-admin/src/main/webapp/static/modular/system/tBill/tBill_info.js
New file
@@ -0,0 +1,106 @@
/**
 * 初始化详情对话框
 */
var TBillInfoDlg = {
    tBillInfoData : {}
};
/**
 * 清除数据
 */
TBillInfoDlg.clearData = function() {
    this.tBillInfoData = {};
}
/**
 * 设置对话框中的数据
 *
 * @param key 数据的名称
 * @param val 数据的具体值
 */
TBillInfoDlg.set = function(key, val) {
    this.tBillInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
    return this;
}
/**
 * 设置对话框中的数据
 *
 * @param key 数据的名称
 * @param val 数据的具体值
 */
TBillInfoDlg.get = function(key) {
    return $("#" + key).val();
}
/**
 * 关闭此对话框
 */
TBillInfoDlg.close = function() {
    parent.layer.close(window.parent.TBill.layerIndex);
}
/**
 * 收集数据
 */
TBillInfoDlg.collectData = function() {
    this
    .set('id')
    .set('orderId')
    .set('billType')
    .set('billHeaderType')
    .set('companyName')
    .set('companyTaxNumber')
    .set('billContent')
    .set('moreContent')
    .set('billAmount')
    .set('addresseeName')
    .set('addresseePhone')
    .set('addresseeEmail')
    .set('state')
    .set('createTime');
}
/**
 * 提交添加
 */
TBillInfoDlg.addSubmit = function() {
    this.clearData();
    this.collectData();
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/tBill/add", function(data){
        Feng.success("添加成功!");
        window.parent.TBill.table.refresh();
        TBillInfoDlg.close();
    },function(data){
        Feng.error("添加失败!" + data.responseJSON.message + "!");
    });
    ajax.set(this.tBillInfoData);
    ajax.start();
}
/**
 * 提交修改
 */
TBillInfoDlg.editSubmit = function() {
    this.clearData();
    this.collectData();
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/tBill/update", function(data){
        Feng.success("修改成功!");
        window.parent.TBill.table.refresh();
        TBillInfoDlg.close();
    },function(data){
        Feng.error("修改失败!" + data.responseJSON.message + "!");
    });
    ajax.set(this.tBillInfoData);
    ajax.start();
}
$(function() {
});
management/guns-admin/src/main/webapp/static/modular/system/tEdition/tEdition.js
New file
@@ -0,0 +1,165 @@
/**
 * 管理初始化
 */
var TEdition = {
    id: "TEditionTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1
};
/**
 * 初始化表格的列
 */
TEdition.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
            {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'},
            {title: '版本编号', field: 'editionNo', visible: true, align: 'center', valign: 'middle'},
            {title: '版本文件', field: 'editionFile', visible: true, align: 'center', valign: 'middle',
                formatter: function (value, row) {
                    return row.editionFile.substr(47,row.editionFile.length)
                }
            },
            {title: '版本公告', field: 'editionAnnouncement', visible: true, align: 'center', valign: 'middle'},
            {title: '端口', field: 'editionPort', visible: false, align: 'center', valign: 'middle'},
            {title: '创建时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'},
        {title: '操作', visible: true, align: 'center', valign: 'middle',width:150,
            formatter: function (value, row) {
                return '<a href="#" onclick="TEdition.delete('+row.id+')" style="color:red">删除</a>'
            }
        }
    ];
};
/**
 * 检查是否选中
 */
TEdition.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        TEdition.seItem = selected[0];
        return true;
    }
};
/**
 * 点击添加
 */
TEdition.openAddTEdition = function () {
    var index = layer.open({
        type: 2,
        title: '添加',
        area: ['100%', '100%'], //宽高
        fix: false, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/tEdition/tEdition_add'
    });
    this.layerIndex = index;
};
/**
 * 打开查看详情
 */
TEdition.openTEditionDetail = function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: '详情',
            area: ['800px', '420px'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/tEdition/tEdition_update/' + TEdition.seItem.id
        });
        this.layerIndex = index;
    }
};
/**
 * 删除
 */
TEdition.delete = function (id) {
    var ajax = new $ax(Feng.ctxPath + "/tEdition/delete", function (data) {
        Feng.success("删除成功!");
        TEdition.table.refresh();
    }, function (data) {
        Feng.error("删除失败!" + data.responseJSON.message + "!");
    });
    ajax.set("tEditionId",id);
    ajax.start();
};
TEdition.previewFile = function(){
    $("#upFile").change(function(){
        var file = document.querySelector('#upFile').files[0];
        var pic = ["apk"];
        var index1 = file.name.lastIndexOf(".");
        var ext = file.name.substr(index1+1);
        for (var a = 0;a < pic.length; a++ ){
            if (ext != pic[a]){
                console.log(pic[a])
                Feng.error("请上传apk文件");
                return;
            }
        }
        if (file) {
            TEdition.uploadApk(file);
        } else {
        }
    });
}
TEdition.uploadApk = function(file){
    var index = layer.load(1, {
        shade: [0.1,'#fff'] //0.1透明度的白色背景
    });
    var formData = new FormData();
    formData.append("myfile", file);
    $.ajax({
        url : Feng.ctxPath + "/mgr/saveApk",
        type : "POST",
        data : formData,
        contentType : false,
        processData : false,
        success : function(data) {
            $("#editionFile").val(data);
            Feng.success("上传成功!");
            layer.close(index);
        },
        error : function() {
            Feng.error("上传失败");
            layer.close(index);
        }
    })
}
/**
 * 查询列表
 */
TEdition.search = function () {
    var queryData = {};
    queryData['createTime'] = $("#createTime").val();
    queryData['editionNo'] = $("#editionNo").val();
    TEdition.table.refresh({query: queryData});
};
/**
 * 重置
 */
TEdition.resetSearch = function (){
    $("#createTime").val('');
    $("#editionNo").val('');
    TEdition.search();
}
$(function () {
    var defaultColunms = TEdition.initColumn();
    var table = new BSTable(TEdition.id, "/tEdition/list", defaultColunms);
    table.setPaginationType("client");
    TEdition.table = table.init();
});
management/guns-admin/src/main/webapp/static/modular/system/tEdition/tEdition_info.js
New file
@@ -0,0 +1,140 @@
/**
 * 初始化详情对话框
 */
var TEditionInfoDlg = {
    tEditionInfoData : {},
    validateFields: {
        editionNo: {
            validators: {
                notEmpty: {
                    message: '版本编号不能为空'
                }
            }
        },
        editionPort: {
            validators: {
                notEmpty: {
                    message: '请选择端口'
                }
            }
        },
        editionAnnouncement: {
            validators: {
                notEmpty: {
                    message: '版本公告不能为空'
                }
            }
        },
    }
};
/**
 * 验证数据是否为空
 */
TEditionInfoDlg.validate = function () {
    $('#editionInfoForm').data("bootstrapValidator").resetForm();
    $('#editionInfoForm').bootstrapValidator('validate');
    return $("#editionInfoForm").data('bootstrapValidator').isValid();
};
/**
 * 清除数据
 */
TEditionInfoDlg.clearData = function() {
    this.tEditionInfoData = {};
}
/**
 * 设置对话框中的数据
 *
 * @param key 数据的名称
 * @param val 数据的具体值
 */
TEditionInfoDlg.set = function(key, val) {
    this.tEditionInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
    return this;
}
/**
 * 设置对话框中的数据
 *
 * @param key 数据的名称
 * @param val 数据的具体值
 */
TEditionInfoDlg.get = function(key) {
    return $("#" + key).val();
}
/**
 * 关闭此对话框
 */
TEditionInfoDlg.close = function() {
    parent.layer.close(window.parent.TEdition.layerIndex);
}
/**
 * 收集数据
 */
TEditionInfoDlg.collectData = function() {
    this
    .set('id')
    .set('editionNo')
    .set('editionFile')
    .set('editionAnnouncement')
    .set('editionPort')
    .set('createTime');
}
/**
 * 提交添加
 */
TEditionInfoDlg.addSubmit = function() {
    this.clearData();
    this.collectData();
    if(!this.validate()){
        return ;
    }
    var editionFile = $("#editionFile").val();
    if ("" == editionFile){
        Feng.info("请上传apk文件");
        return;
    }
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/tEdition/add", function(data){
        Feng.success("添加成功!");
        window.parent.TEdition.table.refresh();
        TEditionInfoDlg.close();
    },function(data){
        Feng.error("添加失败!" + data.responseJSON.message + "!");
    });
    ajax.set(this.tEditionInfoData);
    ajax.start();
}
/**
 * 提交修改
 */
TEditionInfoDlg.editSubmit = function() {
    this.clearData();
    this.collectData();
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/tEdition/update", function(data){
        Feng.success("修改成功!");
        window.parent.TEdition.table.refresh();
        TEditionInfoDlg.close();
    },function(data){
        Feng.error("修改失败!" + data.responseJSON.message + "!");
    });
    ajax.set(this.tEditionInfoData);
    ajax.start();
}
$(function() {
    Feng.initValidator("editionInfoForm", TEditionInfoDlg.validateFields);
});