智慧保安后台管理-外网项目备份
tangzy
2021-09-17 f5d28298d0072bcf1fa2a7bb53c0aeef4b87a031
1.用户
4 files modified
96 ■■■■■ changed files
src/main/java/org/springblade/common/constant/FtpConstant.java 26 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 52 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/entity/User.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/constant/FtpConstant.java
@@ -18,12 +18,12 @@
    /**
     * ftp服务器IP地址
     */
    //String ftpHost_dev = "192.168.0.112";
    String ftpHost_dev = "192.168.0.112";
    /**
     * ftp服务器IP地址
     */
    String ftpHost_dev = "172.19.1.30";
    //String ftpHost_dev = "172.19.1.30";
    /**
     * ftp服务器端口
@@ -33,33 +33,33 @@
    /**
     * ftp服务器用户名
     */
    String ftpUserName = "yly";
    //String ftpUserName = "anonymous";
    //String ftpUserName = "yly";
    String ftpUserName = "anonymous";
    /**
     * ftp服务器密码
     */
    String ftpPassword = "Yly@123";
    //String ftpPassword = "";
    //String ftpPassword = "Yly@123";
    String ftpPassword = "";
    /**
     * ftp服务器路径
     */
    String ftpPath = "yly/anbao/";
    //String ftpPath = "anbao/";
    //String ftpPath = "yly/anbao/";
    String ftpPath = "anbao/";
    /**
     * 本地路径
     */
    String localPath = "/home/zhongsong/anbao/";
    //String localPath = "D:\\anbao\\";
    //String localPath = "/home/zhongsong/anbao/";
    String localPath = "D:\\anbao\\";
    //minio内网ip
    String ip = "http://47.49.21.216:9000";
    //String ip = "http://223.82.109.183:2081";
    //tring ip = "http://223.82.109.183:2081";
    String jsonUrl = "/home/zhongsong/anbao/";
    //String jsonUrl = "D:\\anbao\\";
    //String jsonUrl = "/home/zhongsong/anbao/";
    String jsonUrl = "D:\\anbao\\";
}
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -29,6 +29,7 @@
import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import org.springblade.common.cache.DictCache;
import org.springblade.common.constant.FtpConstant;
import org.springblade.common.enums.DictEnum;
import org.springblade.common.utils.arg;
import org.springblade.core.cache.utils.CacheUtil;
@@ -201,13 +202,14 @@
            Jurisdiction one = jurisdictionService.getOne(Condition.getQueryWrapper(jurisdiction));
            user.setJurisdiction(one.getId().toString());
        }
        user.setRoleId("1412226235153731586");
        userService.submit(user);
        //        String birthday = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getBirthday());
        String rtime = null;
        if (null!=user.getRtime()) {
            rtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getRtime());
        }
        String s = "insert into blade_user(id,tenant_id,account,password,name,real_name,avatar,email,phone,birthday,sex,role_id,dept_id,cardid,nativePlace,nation,education," +
        String s = "insert into blade_user(id,tenant_id,account,password,name,real_name,avatar,email,phone,sex,role_id,dept_id,cardid,nativePlace,nation,education," +
            "politicaloutlook,healstats,height,address,registered,rtime,securitynumber,hold,jurisdiction) " +
            "values(" + "'" + user.getId() + "'" + "," + "'" + 000000 + "'" + "," + "'" + user.getAccount() + "'" + "," +
            "'" + user.getPassword() + "'" + "," +"'" + user.getName() + "'" + "," + "'" + user.getRealName() + "'" + "," + "'" + user.getAvatar() + "'" + "," +
@@ -234,27 +236,23 @@
        String rtime;
        if (user.getBirthday()==null){
             birthday =null;
        }
        else {
        } else {
             birthday = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getBirthday());
        }
        if ( user.getRtime()==null){
             rtime =null;
        }
        else {
        } else {
             rtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getRtime());
        }
        String s1 =
            "update blade_user set account = " + "'" + user.getAccount()+ "'"
                + ",password = " + "'" + user.getPassword()+"'"
                + ",name = " + "'" + user.getName()+"'"
                + ",real_name = " + "'" + user.getRealName()+"'"
                + ",avatar = " + "'" + user.getAvatar()+"'"
                + ",email = " + "'" + user.getEmail()+"'"
                + ",phone = " + "'" + user.getPhone()+"'"
                + ",birthday = " + "'" + birthday+"'"
                + ",sex = " + "'" + user.getSex()+"'"
                + ",role_id = " + "'" + user.getRoleId()+"'"
                + ",dept_id = " + "'" + user.getDeptId()+"'"
@@ -271,6 +269,7 @@
                + ",securitynumber = " + "'" +user.getSecuritynumber()+"'"
                + ",hold = " + "'" +user.getHold()+"'"
                + ",jurisdiction = " + "'" +user.getJurisdiction()+"'"
                + ",reason_for_leav = " + "'" + user.getReasonForLeav() + "'"
                + " " +"where id = " + "'" + user.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        return R.success("修改成功");
@@ -549,6 +548,7 @@
        List<Map<Object, Object>> list = userService.selectInr(deptid);
        return R.data(list);
    }
    @GetMapping("/zc")
    public R zc(String username,String password) {
        User user = new User();
@@ -604,29 +604,43 @@
        String rtime;
        if (user.getBirthday()==null){
            birthday =null;
        }
        else {
        } else {
            birthday = new SimpleDateFormat("yyyy-MM-dd").format(user.getBirthday());
        }
        if ( user.getRtime()==null){
            rtime =null;
        }
        else {
        } else {
            rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
        }
        String urla = "";
        String[] split = user.getAvatar().split(",");
        for (int i = 0; i < split.length; i++) {
            String s = split[i].substring(26, split[i].length());
            urla += FtpConstant.ip + s + ",";
        }
        String substring = urla.substring(0, urla.length() - 1);
        user.setAvatar(substring);
        String urlf = "";
        String[] splits = user.getFingerprint().split(",");
        for (int i = 0; i < splits.length; i++) {
            String s = splits[i].substring(26, splits[i].length());
            urlf += FtpConstant.ip + s + ",";
        }
        String substrings = urla.substring(0, urlf.length() - 1);
        user.setFingerprint(substrings);
        String s = "insert into blade_user(id,tenant_id,account,password,name,real_name,avatar,email,phone,birthday,sex,role_id,dept_id,cardid,nativePlace,nation,education," +
            "politicaloutlook,healstats,height,address,registered,rtime,securitynumber,hold,jurisdiction,dispatch) " +
            "values(" + "'" + user.getId() + "'" + "," + "'" + 000000 + "'" + "," + "'" + user.getAccount() + "'" + "," +
        String s = "insert into blade_user(id,tenant_id,account,password,name,real_name,avatar,email,phone,sex,role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
            "politicaloutlook,healstats,height,address,registered,rtime,securitynumber,hold,jurisdiction,status,is_deleted,dispatch) " +
            "values(" + "'" + user.getId() + "'" + "," + "'" + user.getTenantId() + "'" + "," + "'" + user.getAccount() + "'" + "," +
            "'" + user.getPassword() + "'" + "," +"'" + user.getName() + "'" + "," + "'" + user.getRealName() + "'" + "," + "'" + user.getAvatar() + "'" + "," +
            "'" + user.getEmail() + "'" + "," + "'" + user.getPhone() + "'" + "," + "'" + birthday + "'" + "," + "'" + user.getSex() + "'" + "," + "'" + user.getRoleId() + "'" +
            "'" + user.getEmail() + "'" + "," + "'" + user.getPhone() + "'" + "," + "'" + user.getSex() + "'" + "," + "'" + user.getRoleId() + "'" +
            "," + "'" + user.getDeptId() + "'" +
            "," + "'" + user.getCardid() + "'" +
            "," + "'" + user.getNativeplace() + "'" +
            "," + "'" + user.getNation() + "'" +
            "," + "'" + user.getFingerprint() + "'" +
            "," + "'" + user.getEducation() + "'" +
            "," + "'" + user.getPoliticaloutlook() + "'" +
            "," + "'" + user.getHealstats() + "'"
@@ -636,6 +650,8 @@
            "'" + rtime + "'"+ "," + "'" + user.getSecuritynumber() + "'"+
            "," + "'" + user.getHold() + "'"+
            "," + "'" + user.getJurisdiction() + "'"+
            "," + "'" + user.getStatus() + "'" +
            "," + "'" + user.getIsDeleted() + "'" +
            "," + "'" + user.getDispatch() + "'"+")";
        FtpUtil.sqlFileUpload(s);
@@ -660,6 +676,7 @@
    /**
     * 保安员信息
     *
     * @param user
     * @return
     */
@@ -670,7 +687,6 @@
    /**
     *
     * @param type  1:保安 2:公安
     * @param deptid
     * @param jurisdiction
@@ -681,7 +697,5 @@
        List<Map<String, Object>> list = userService.seleL(type,deptid, jurisdiction,userId);
        return R.data(list);
    }
}
src/main/java/org/springblade/modules/system/entity/User.java
@@ -128,7 +128,7 @@
     * 身高
     */
    @ApiModelProperty(value = "身高")
    private Integer height;
    private String height;
    /**
     * 联系电话
     */
@@ -231,5 +231,20 @@
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField("paper_time")
    private Date paperTime;
    /**
     * 离职原因
     */
    @TableField("reason_for_leav")
    private String reasonForLeav;
    private String holdv;
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date holdvtime;
    /**
     * 是否缴纳保险 0:是   1:否
     */
    private Integer insurance;
}
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -47,6 +47,7 @@
        <result column="birthtime" property="birthtime"/>
        <result column="healstats" property="healstats"/>
        <result column="soil" property="soil"/>
        <result column="reason_for_leav" property="reasonForLeav"/>
    </resultMap>
    <!--带坐标-->