智慧保安后台管理-外网项目备份
Administrator
2021-12-01 932b3f67c68a5fd5a9befba40c503c94d9055adf
枪支新增字段
4 files modified
24 ■■■■ changed files
src/main/java/org/springblade/modules/equipage/controller/GunController.java 5 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/entity/Gun.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/excel/GunExcel.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/service/impl/GunServiceImpl.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/controller/GunController.java
@@ -87,7 +87,7 @@
            //数据同步
            String s1 =
                "insert into sys_gun(id,issue_unit,card_number,gun_mode," +
                    "dept_id,person_in_charge,issue_time,valid_time,jurisdiction) " +
                    "dept_id,person_in_charge,issue_time,valid_time,jurisdiction,card_no) " +
                    "values(" + "'" + gun.getId() + "'" + "," +
                    "'" + gun.getIssueUnit() + "'" + "," +
                    "'" + gun.getCardNumber() + "'" + "," +
@@ -96,6 +96,7 @@
                    "'" + gun.getPersonInCharge() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getIssueTime()) + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getValidTime()) + "'" + "," +
                    "'" +gun.getCardNo() + "'" + "," +
                    "'" +gun.getJurisdiction() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
        }else {
@@ -111,6 +112,7 @@
                    ",issue_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getIssueTime()) + "'" +
                    ",valid_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(gun.getValidTime()) + "'" +
                    ",jurisdiction = " + "'" + gun.getJurisdiction() + "'" +
                    ",card_no = " + "'" + gun.getCardNo() + "'" +
                    " " +"where id = " + "'" + gun.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
        }
@@ -168,6 +170,7 @@
        gunExcel1.setGunMode("x****");
        gunExcel1.setIssueUnit("*****");
        gunExcel1.setPersonInCharge("张三");
        gunExcel1.setCardNo("360112**********");
        list.add(gunExcel1);
        String fileName = null;
        try {
src/main/java/org/springblade/modules/equipage/entity/Gun.java
@@ -80,4 +80,10 @@
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date validTime;
    /**
     * 护卫人身份证号码
     */
    @TableField("card_no")
    private String cardNo;
}
src/main/java/org/springblade/modules/equipage/excel/GunExcel.java
@@ -81,6 +81,14 @@
    /**
     * 责任人
     */
    @ColumnWidth(20)
    @ExcelProperty("责任人身份证号码")
    private String cardNo;
    /**
     * 枪型
     */
    @ColumnWidth(10)
src/main/java/org/springblade/modules/equipage/service/impl/GunServiceImpl.java
@@ -83,13 +83,14 @@
                //数据同步
                String s1 =
                    "insert into sys_gun(id,issue_unit,card_number,gun_mode," +
                        "dept_id,person_in_charge) " +
                        "dept_id,person_in_charge,card_no) " +
                        "values(" + "'" + gun.getId() + "'" + "," +
                        "'" + gun.getIssueUnit() + "'" + "," +
                        "'" + gun.getCardNumber() + "'" + "," +
                        "'" + gun.getGunMode() + "'" + "," +
                        "'" + gun.getDeptId() + "'" + "," +
                        "'" +gun.getPersonInCharge() + "'" + ")";
                        "'" + gun.getPersonInCharge() + "'" + "," +
                        "'" +gun.getCardNo() + "'" + ")";
                FtpUtil.sqlFileUpload(s1);
            });