智慧保安后台管理-外网
tangzy
2021-09-18 9e58204aa95776a812c43d0dbd52e41e855b54ef
1.ftp
10 files modified
170 ■■■■ changed files
src/main/java/org/springblade/common/constant/FtpConstant.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/controller/EquipageController.java 6 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationController.java 49 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/entity/Information.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/member/controller/MemberController.java 27 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/shareholder/controller/ShareholderController.java 32 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/shareholder/entity/Shareholder.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java 24 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/constant/FtpConstant.java
@@ -57,8 +57,8 @@
    //minio内网ip
    String ip = "http://47.49.21.216:9000";
    //tring ip = "http://223.82.109.183:2081";
    //String ip = "http://47.49.21.216:9000";
    String ip = "http://223.82.109.183:2081";
    //String jsonUrl = "/home/zhongsong/anbao/";
    String jsonUrl = "D:\\anbao\\";
src/main/java/org/springblade/modules/equipage/controller/EquipageController.java
@@ -82,7 +82,7 @@
            //数据推送
            String s1 =
                "insert into sys_equipage(id,name,number,specifications,mode,dept_id,brand,date_for_production,jurisdiction,user_id,num) " +
                "insert into sys_equipage(id,name,number,specifications,mode,dept_id,brand,date_for_production,jurisdiction,person_in_charge,num) " +
                    "values(" + "'" + equipage.getId() + "'" + "," +
                    "'" + equipage.getName() + "'" + "," +
                    "'" + equipage.getNumber() + "'" + "," +
@@ -92,7 +92,7 @@
                    "'" + equipage.getBrand() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd").format(equipage.getDateForProduction()) + "'" + "," +
                    "'" + equipage.getJurisdiction() + "'" + "," +
                    "'" + equipage.getUserId() + "'" + "," +
                    "'" + equipage.getPersonInCharge() + "'" + "," +
                    "'" +equipage.getNum() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
        }else {
@@ -108,8 +108,8 @@
                    ",brand = " + "'" + equipage.getBrand() + "'" +
                    ",date_for_production = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(equipage.getDateForProduction()) + "'" +
                    ",jurisdiction = " + "'" + equipage.getJurisdiction() + "'" +
                    ",user_id = " + "'" + equipage.getUserId() + "'" +
                    ",num = " + "'" + equipage.getNum() + "'" +
                    ",person_in_charge = " + "'" + equipage.getPersonInCharge() + "'" +
                    " " +"where id = " + "'" + equipage.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
        }
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -184,7 +184,7 @@
            information.setDepartmentid(id);
        }
        informationService.save(information);
        String formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(information.getEstablishtime());
        String formatStr = new SimpleDateFormat("yyyy-MM-dd").format(information.getEstablishtime());
        //Integer id = information.getId();
        String s = "insert into sys_information(id,creditCode,enterpriseName,representative,establishTime," +
            "registeredCapital,organizationCode,registrationNumber, enterprises, address," +
@@ -209,17 +209,25 @@
    @ApiOperation(value = "修改", notes = "传入information")
    public R update(@Valid @RequestBody Information information) throws Exception {
        informationService.updateById(information);
        String businessLicense=null;
        String licence=null;
        String format="";
        if(information.getBusinessLicense()!=null && !"".equals(information.getBusinessLicense())){
             businessLicense = information.getBusinessLicense().substring(26, information.getBusinessLicense().length());
        String businessLicense = null;
        String businessLicenses = null;
        String licence = null;
        String licences = null;
        String format = "";
        if (information.getBusinessLicense() != null && !"".equals(information.getBusinessLicense())) {
            businessLicense = information.getBusinessLicense().substring(26, information.getBusinessLicense().length());
            businessLicenses = FtpConstant.ip + businessLicense;
        } else {
            businessLicenses = "";
        }
        if(information.getLicence()!=null && !"".equals(information.getLicence())){
             licence = information.getLicence().substring(26, information.getLicence().length());
        if (information.getLicence() != null && !"".equals(information.getLicence())) {
            licence = information.getLicence().substring(26, information.getLicence().length());
            licences = FtpConstant.ip + licence;
        } else {
            licences = "";
        }
        if (information.getEstablishtime()!=null && !"".equals(information.getEstablishtime())){
             format = new SimpleDateFormat("yyyy-MM-dd").format(information.getEstablishtime());
        if (information.getEstablishtime() != null && !"".equals(information.getEstablishtime())) {
            format = new SimpleDateFormat("yyyy-MM-dd").format(information.getEstablishtime());
        }
        //内网同步
        String s1 = "update sys_information set creditCode = " + "'" + information.getCreditcode() + "'" +
@@ -239,8 +247,8 @@
            ",representativecell = " + "'" + information.getRepresentativecell() + "'" +
            ",contacts = " + "'" + information.getContacts() + "'" +
            ",contactscell = " + "'" + information.getContactscell() + "'" +
            ",business_License = " + "'" + FtpConstant.ip + businessLicense + "'" +
            ",licence = " + "'" + FtpConstant.ip + licence + "'" +
            ",business_License = " + "'" + businessLicenses + "'" +
            ",licence = " + "'" + licences + "'" +
            " " + "where id = " + "'" + information.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        return R.success("修改成功");
@@ -284,8 +292,8 @@
     * 统计保安员资格异常的数量
     */
    @PostMapping("/selectExtype")
    public R selectExtype(String deptid,String jurisdiction) {
        List<Map<Object, Object>> lists = informationService.selectExtype(deptid,jurisdiction);
    public R selectExtype(String deptid, String jurisdiction) {
        List<Map<Object, Object>> lists = informationService.selectExtype(deptid, jurisdiction);
        return R.data(lists);
    }
@@ -293,8 +301,8 @@
     * 统计保安员持证的数量
     */
    @PostMapping("/selectHold")
    public R selectHold(String deptid,String jurisdiction) {
        List<Map<Object, Object>> lists = informationService.selectHold(deptid,jurisdiction);
    public R selectHold(String deptid, String jurisdiction) {
        List<Map<Object, Object>> lists = informationService.selectHold(deptid, jurisdiction);
        return R.data(lists);
    }
@@ -311,8 +319,8 @@
     * 保安派遣数量统计
     */
    @PostMapping("/selectDisp")
    public R selectDisp(String deptid,String jurisdiction) {
        List<Map<Object, Object>> lists = informationService.selectDisp(deptid,jurisdiction);
    public R selectDisp(String deptid, String jurisdiction) {
        List<Map<Object, Object>> lists = informationService.selectDisp(deptid, jurisdiction);
        return R.data(lists);
    }
@@ -320,8 +328,8 @@
     * 社保统计
     */
    @PostMapping("/selectSoil")
    public R selectSoil(String deptid,String jurisdiction) {
        List<Map<Object, Object>> lists = informationService.selectSoil(deptid,jurisdiction);
    public R selectSoil(String deptid, String jurisdiction) {
        List<Map<Object, Object>> lists = informationService.selectSoil(deptid, jurisdiction);
        List<Map<String, Object>> list = new ArrayList<>();
        for (int i = 0; i < lists.size(); i++) {
            Map<String, Object> map = new HashMap<String, Object>();
@@ -361,6 +369,7 @@
        List list = informationService.queryYearKh(year, jurisdiction, deptid);
        return list;
    }
    //升序
    public static Map<String, String> sortMapBykeyAsc(Map<String, String> oriMap) {
        Map<String, String> sortedMap = new LinkedHashMap<String, String>();
src/main/java/org/springblade/modules/information/entity/Information.java
@@ -65,6 +65,8 @@
     * 成立日期
     */
    @ApiModelProperty(value = "成立日期")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField("establishTime")
    private Date establishtime;
    /**
src/main/java/org/springblade/modules/member/controller/MemberController.java
@@ -29,6 +29,7 @@
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.FTP.FtpUtil;
import org.springblade.modules.equipage.excel.EquipageExcel;
import org.springblade.modules.member.entity.Member;
import org.springblade.modules.member.excel.memberExcel;
@@ -42,6 +43,7 @@
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
@@ -99,8 +101,17 @@
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入member")
    public R save(@Valid @RequestBody Member member) throws Exception {
        //arg.test01(arg.url+"/member/save",member);
        return R.status(memberService.save(member));
        boolean save = memberService.save(member);
        String s1 =
            "insert into sys_member(id,name,post,cardid,cell,creditCode) " +
                "values(" + "'" + member.getId() + "'" + "," +
                "'" + member.getName() + "'" + "," +
                "'" + member.getPost() + "'" + "," +
                "'" + member.getCardid() + "'" + "," +
                "'" + member.getCell() + "'"+"," +
                "'" + member.getCreditcode() + "'"+")";
        FtpUtil.sqlFileUpload(s1);
        return R.status(save);
    }
    /**
@@ -110,8 +121,16 @@
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入member")
    public R update(@Valid @RequestBody Member member) throws Exception {
        //arg.test01(arg.url+"/member/update",member);
        return R.status(memberService.updateById(member));
        boolean b = memberService.updateById(member);
        String s1 = "update sys_member set name = " + "'" + member.getName() + "'" +
            ",post = " + "'" + member.getPost() + "'" +
            ",cardid = " + "'" + member.getCardid() + "'" +
            ",cell = " + "'" + member.getCell() + "'" +
            ",cardid = " + "'" + member.getCardid() + "'" +
            ",creditCode = " + "'" + member.getCreditcode() + "'" +
            " " + "where id = " + "'" + member.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        return R.status(b);
    }
    /**
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
@@ -631,7 +631,23 @@
            "insert into blade_attach(id,tenant_id,link,domain,name,original_name,extension,attach_size,create_user,deptid," +
                "create_time,update_user,update_time,status,is_deleted,type,cardid";
        if (noticeId != null) {
            s1 += ",notice_id";
            s1 += ",notice_id"+")" +"values(" + "'" + attach.getId() + "'" + "," +
                "'" + attach.getTenantId() + "'" + "," +
                "'" + imgurl + "'" + "," +
                "'" + ip + "'" + "," +
                "'" + split[2] + "'" + "," +
                "'" + attach.getOriginalName() + "'" + "," +
                "'" + attach.getExtension() + "'" + "," +
                "'" + attach.getAttachSize() + "'" + "," +
                "'" + attach.getCreateUser() + "'" + "," +
                "'" + attach.getDeptid() + "'" + "," +
                "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," +
                "'" + attach.getUpdateUser() + "'" + "," +
                "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + "," +
                "'" + attach.getStatus() + "'" + "," +
                "'" + attach.getIsDeleted() + "'" + "," +
                "'" + attach.getType() + "'" + "," +
                "'" + cardid + "'";
        } else {
            s1 += ") " +
                "values(" + "'" + attach.getId() + "'" + "," +
@@ -653,7 +669,7 @@
                "'" + cardid + "'";
        }
        if (noticeId != null) {
            s1 += "'" + noticeId + "'" + ")";
            s1 += ","+"'" + noticeId + "'" + ")";
        } else {
            s1 += ")";
        }
src/main/java/org/springblade/modules/shareholder/controller/ShareholderController.java
@@ -29,6 +29,7 @@
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.FTP.FtpUtil;
import org.springblade.modules.information.excel.InforExcel;
import org.springblade.modules.information.excel.InforImporter;
import org.springblade.modules.member.excel.memberExcel;
@@ -42,6 +43,7 @@
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
@@ -99,9 +101,19 @@
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入shareholder")
    public R save(@Valid @RequestBody Shareholder shareholder) throws Exception {
        //arg arg = new arg();
        //arg.test01(arg.url+"/shareholder/save",shareholder);
        return R.status(shareholderService.save(shareholder));
        boolean save = shareholderService.save(shareholder);
        String s1 =
            "insert into sys_shareholder(id,shareholder,shareholdingratio,capital,capitalTime,cardid,cell,creditCode) " +
                "values(" + "'" + shareholder.getId() + "'" + "," +
                "'" + shareholder.getShareholder() + "'" + "," +
                "'" + shareholder.getShareholdingratio() + "'" + "," +
                "'" + shareholder.getCapital() + "'" + "," +
                "'" + new SimpleDateFormat("yyyy-MM-dd").format(shareholder.getCapitaltime()) + "'"+"," +
                "'" + shareholder.getCardid() + "'"+"," +
                "'" + shareholder.getCell() + "'"+"," +
                "'" + shareholder.getCreditcode() + "'" + ")";
        FtpUtil.sqlFileUpload(s1);
        return R.status(save);
    }
    /**
@@ -111,8 +123,18 @@
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入shareholder")
    public R update(@Valid @RequestBody Shareholder shareholder) throws Exception {
        //arg.test01(arg.url+"/shareholder/update",shareholder);
        return R.status(shareholderService.updateById(shareholder));
        boolean b = shareholderService.updateById(shareholder);
        //内网同步
        String s1 = "update sys_shareholder set shareholder = " + "'" + shareholder.getShareholder() + "'" +
            ",shareholdingratio = " + "'" + shareholder.getShareholdingratio() + "'" +
            ",capital = " + "'" + shareholder.getCapital() + "'" +
            ",capitalTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(shareholder.getCapitaltime()) + "'" +
            ",cardid = " + "'" + shareholder.getCardid() + "'" +
            ",cell = " + "'" + shareholder.getCell() + "'" +
            ",creditCode = " + "'" + shareholder.getCreditcode() + "'" +
            " " + "where id = " + "'" + shareholder.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        return R.status(b);
    }
    /**
src/main/java/org/springblade/modules/shareholder/entity/Shareholder.java
@@ -20,9 +20,11 @@
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
@@ -62,6 +64,8 @@
     * 出资时间
     */
    @ApiModelProperty(value = "出资时间")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField("capitalTime")
    private Date capitaltime;
    /**
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -243,7 +243,7 @@
        if (user.getRtime() == null) {
            rtime = null;
        } else {
            rtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user.getRtime());
            rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
        }
        String s1 =
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -40,6 +40,7 @@
import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.*;
import org.springblade.modules.FTP.FtpUtil;
import org.springblade.modules.auth.enums.UserEnum;
import org.springblade.modules.dispatcher.service.IDispatcherService;
import org.springblade.modules.dispatcher.vo.DispatcherUnitVO;
@@ -107,7 +108,27 @@
//        if (userCount > 0 && Func.isEmpty(user.getId())) {
//            throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
//        }
        return save(user) && submitUserDept(user);
        boolean b = save(user) && submitUserDept(user);
        String s = "insert into blade_user(id,tenant_id,account,password,real_name,email,phone,sex,role_id,dept_id,cardid,nativePlace,nation," +
            "politicaloutlook,healstats,height,address,registered,rtime,securitynumber,hold,status,dispatch) " +
            "values(" + "'" + user.getId() + "'" + "," + "'" + user.getTenantId() + "'" + "," + "'" + user.getAccount() + "'" + "," +
            "'" + user.getPassword() + "'"+ "," + "'" + user.getRealName() + "'"+ "," +
            "'" + user.getEmail() + "'" + "," + "'" + user.getPhone() + "'" + "," + "'" + user.getSex() + "'" + "," + "'" + user.getRoleId() + "'" +
            "," + "'" + user.getDeptId() + "'" +
            "," + "'" + user.getCardid() + "'" +
            "," + "'" + user.getNativeplace() + "'" +
            "," + "'" + user.getNation() + "'" +
            "," + "'" + user.getPoliticaloutlook() + "'" +
            "," + "'" + user.getHealstats() + "'"
            + "," + "'" + user.getHeight() + "'" +
            "," + "'" + user.getAddress() + "'" +
            "," + "'" + user.getRegistered() + "'" + "," +
            "'" + user.getRtime() + "'" + "," + "'" + user.getSecuritynumber() + "'" +
            "," + "'" + user.getHold() + "'" +
            "," + "'" + user.getStatus() + "'" +
            "," + "'" + user.getDispatch() + "'" + ")";
        FtpUtil.sqlFileUpload(s);
        return b;
    }
    @Override
@@ -565,6 +586,7 @@
            user.setTenantId("000000");
            //默认在职
            user.setStatus(1);
            user.setDispatch("1");
            //判断是否持证
            if (null != userExcel.getHold() && userExcel.getHold() != "") {
                if (userExcel.getHold().equals("是")) {