智慧保安后台管理-外网
1.现场检查接口修改
2.车辆位置新增接口
3.成绩导出接口修改
4.公司信息接口修改,新增创建时间和创建人
18 files modified
1 files added
501 ■■■■ changed files
src/main/java/org/springblade/modules/coinspect/mapper/CoinspectMapper.xml 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java 38 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/excel/ExportExamScoreExcel.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml 9 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java 51 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/vo/ExamScoreVO.java 22 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationController.java 95 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/entity/Information.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.java 14 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml 19 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/service/IInformationService.java 12 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java 21 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/location/controller/LiveLocationController.java 88 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/location/vo/LiveLocationVOTest.java 42 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/seinspect/mapper/SeinspectMapper.xml 17 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/seinspect/vo/SeinspectVO.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 19 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/entity/Dept.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/coinspect/mapper/CoinspectMapper.xml
@@ -37,16 +37,16 @@
            bd1.id = sc.reviewed_dept_id
        where 1 = 1
        <if test="coinspect.realName!=null and coinspect.realName!=''">
            bu.real_name like concat('%',#{coinspect.realName},'%')
            and bu.real_name like concat('%',#{coinspect.realName},'%')
        </if>
        <if test="coinspect.examinerDeptName!=null and coinspect.examinerDeptName!=''">
            bd.dept_name like concat('%',#{coinspect.examinerDeptName},'%')
            and bd.dept_name like concat('%',#{coinspect.examinerDeptName},'%')
        </if>
        <if test="coinspect.reviewedDeptName!=null and coinspect.reviewedDeptName!=''">
            bd1.dept_name like concat('%',#{coinspect.reviewedDeptName},'%')
            and bd1.dept_name like concat('%',#{coinspect.reviewedDeptName},'%')
        </if>
        <if test="coinspect.results!=null and coinspect.results!=''">
            sc.results like concat('%',#{coinspect.results},'%')
            and sc.results like concat('%',#{coinspect.results},'%')
        </if>
    </select>
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java
@@ -155,12 +155,17 @@
            ExamScore examScore1 = examScoreService.getById(examScore.getId());
            //查询当前保安信息
            UserVO user = userService.getUserAgeById(Long.parseLong(examScore1.getUserId()));
            //再根据身份证号查询用户,方式用户考了试,被删除,又新建的情况,修改最新用户的状态信息
            User user1 = userService.getUserInfoByIdCardNo(user.getCardid());
            //考试合格
            if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
                //合格
                examScore.setQualified(0);
                //正式考试通过生成保安证编号
                ExamPaper paper = examPaperService.getById(examScore.getExamId());
//                if (paper.getExamType() == 1) {
                //如果已有保安证编号,不更新用户信息
                if (null==user1.getSecuritynumber() || user1.getSecuritynumber()=="") {
                    //去生成保安证编号
                    String pre = SecurityPaperUtil.getSecurityPaper();
                    //查询当前年份已有的保安证编号
@@ -174,37 +179,45 @@
                        max++;
                        result = pre + (decimalFormat.format(max));
                    }
                    user.setSecuritynumber(result);
                    user1.setSecuritynumber(result);
                    //发证日期
                    user.setPaperTime(new Date());
                    user1.setPaperTime(new Date());
                    //修改为持证保安
                    user.setHold("1");
                    user1.setHold("1");
                    //分配保安角色
//                    Role role = new Role();
//                    role.setRoleAlias("保安");
//                    Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
//                    user.setRoleId(oneRole.getId().toString());
                    //更新保安数据
                    userService.updateById(user);
                    userService.updateById(user1);
                    String s1 =
                        "update blade_user set hold = " + "'" + user.getHold() + "'" +
                            ",securitynumber = " + "'" + user.getSecuritynumber() + "'" +
                            ",paper_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime()) + "'" +
                            " " + "where id = " + "'" + user.getId() + "'";
                        "update blade_user set hold = " + "'" + user1.getHold() + "'" +
                            ",securitynumber = " + "'" + user1.getSecuritynumber() + "'" +
                            ",paper_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(user1.getPaperTime()) + "'" +
                            " " + "where id = " + "'" + user1.getId() + "'";
                    FtpUtil.sqlFileUpload(s1);
//                }
                }
            } else {
                //不合格
                examScore.setQualified(1);
            }
            //总成绩
            if (user.getAge() <= 50) {
                examScore.setAllGrade(Math.round((examScore.getLearnGrade() + examScore1.getTheoryGrade()) / 2));
                if (null!=examScore1.getTheoryGrade()) {
                    examScore.setAllGrade(Math.round((examScore.getLearnGrade() + examScore1.getTheoryGrade()) / 2));
                }else {
                    examScore.setAllGrade(Math.round(examScore.getLearnGrade()/2));
                }
            }
            if (user.getAge() > 50) {
                examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore1.getTheoryGrade() * 0.5)))
                    + Integer.parseInt(String.valueOf(Math.round(examScore1.getLearnGrade() * 0.5))));
                if (null!=examScore1.getTheoryGrade()) {
                    examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore1.getTheoryGrade() * 0.5)))
                        + Integer.parseInt(String.valueOf(Math.round(examScore.getLearnGrade() * 0.5))));
                }else {
                    examScore.setAllGrade(Math.round(examScore.getLearnGrade()/2));
                }
            }
        }
        //内网同步
@@ -214,7 +227,6 @@
                ",qualified = " + "'" + examScore.getQualified() + "'" +
                " " + "where id = " + "'" + examScore.getId() + "'";
        FtpUtil.sqlFileUpload(s1);
        //本地修改
        return R.status(examScoreService.updateById(examScore));
src/main/java/org/springblade/modules/exam/excel/ExportExamScoreExcel.java
@@ -48,6 +48,10 @@
    @ExcelProperty("身份证号码")
    private String idCardNo;
    @ColumnWidth(20)
    @ExcelProperty("准考证号")
    private String candidateNo;
    @ColumnWidth(25)
    @ExcelProperty("所属公司")
    private String companyName;
src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml
@@ -6,7 +6,7 @@
    <select id="selectExamScorePage" resultType="org.springblade.modules.exam.vo.ExamScoreVO">
        SELECT
        es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId,
        es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified,
        es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified,es.candidate_no candidateNo,
        ke.exam_name examName,
        sa.is_exam isExam,
        bu.real_name securityName,company,bu.account,
@@ -68,10 +68,10 @@
    <select id="selectTrainExamScorePage" resultType="org.springblade.modules.exam.vo.ExamScoreVO">
        SELECT
            es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId,
            es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified,
            es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified,es.candidate_no candidateNo,
            ke.exam_name examName,
            str.is_exam isExam,
            bu.real_name securityName,company,bu.account,
            bu.real_name securityName,company,bu.account,bu.sex,bu.paper_time paperTime,bu.securitynumber securityNumber,bu.avatar,
            bd.dept_name companyName from
            exam_score es
        left join
@@ -129,6 +129,7 @@
        <if test="examScore.examDate!=null">
            and date_format(es.exam_time,'%Y-%m-%d') = #{examScore.examDate}
        </if>
        order by es.id desc
    </select>
    <!--考试成绩详情信息-->
@@ -324,7 +325,7 @@
        SELECT
        ke.exam_name examName,bu.real_name securityName,bu.cardid idCardNo,
        bd.dept_name companyName,
        es.exam_time examTime,exam_end_time examEndTime,
        es.exam_time examTime,exam_end_time examEndTime,es.candidate_no candidateNo,
        es.theory_grade theoryGrade,es.learn_grade learnGrade,
        all_grade allGrade
         from
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springblade.common.utils.arg;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition;
@@ -37,6 +38,7 @@
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import static com.bstek.ureport.expression.model.condition.Join.and;
@@ -245,6 +247,10 @@
    @Override
    public void importExamScore(List<ExamScoreExcel> examScoreExcelList, Boolean isCovered) {
        if (examScoreExcelList.size()>0){
            List<Object> errorList = new ArrayList<>();
            //导入状态,默认为true ,如果有一个出现问题则为 false
            AtomicBoolean status = new AtomicBoolean(true);
            //遍历
            examScoreExcelList.forEach(examScoreExcel -> {
                if (null!=examScoreExcel.getLearnGrade() && null!=examScoreExcel.getIdCardNo() && examScoreExcel.getIdCardNo()!=""){
                    //使用考试名称匹配考试信息
@@ -270,6 +276,8 @@
                            examScore.setQualified(0);
                            //正式考试通过生成保安证编号
//                            if (examPaper.getExamType()==1) {
                            //如果已有保安证编号,不更新用户信息
                            if (null==user.getSecuritynumber() || user.getSecuritynumber()=="") {
                                //去生成保安证编号
                                String pre = SecurityPaperUtil.getSecurityPaper();
                                //查询当前年份已有的保安证编号
@@ -288,32 +296,41 @@
                                user.setPaperTime(new Date());
                                //修改为持证保安
                                user.setHold("1");
                                //分配保安角色
//                                Role role = new Role();
//                                role.setRoleAlias("保安");
//                                Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
//                                user.setRoleId(oneRole.getId().toString());
                                //更新保安数据
                                userService.updateById(user);
                                String s1 =
                                    "update blade_user set hold = " + "'" +  user.getHold() + "'" +
                                    "update blade_user set hold = " + "'" + user.getHold() + "'" +
                                        ",securitynumber = " + "'" + user.getSecuritynumber() + "'" +
                                        ",paper_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime()) + "'" +
                                        " " +"where id = " + "'" + user.getId() + "'";
                                        " " + "where id = " + "'" + user.getId() + "'";
                                FtpUtil.sqlFileUpload(s1);
                            }
                            //分配保安角色
//                                Role role = new Role();
//                                role.setRoleAlias("保安");
//                                Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
//                                user.setRoleId(oneRole.getId().toString());
//                            }
                        } else {
                            //不合格
                            examScore.setQualified(1);
                        }
                        //总成绩
                        if (user.getAge()<=50) {
                            examScore.setAllGrade(Math.round((examScore.getTheoryGrade()+examScoreExcel.getLearnGrade())/2));
                        if (user.getAge() <= 50) {
                            if (null!=examScore.getTheoryGrade()) {
                                examScore.setAllGrade(Math.round((examScore.getTheoryGrade() + examScoreExcel.getLearnGrade()) / 2));
                            }else {
                                examScore.setAllGrade(Math.round(examScoreExcel.getLearnGrade() / 2));
                            }
                        }
                        if (user.getAge()>50) {
                            examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore.getTheoryGrade()*0.5)))
                                + Integer.parseInt(String.valueOf(Math.round(examScoreExcel.getLearnGrade()*0.5))));
                        if (user.getAge() > 50) {
                            if (null!=examScore.getTheoryGrade()) {
                                examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore.getTheoryGrade() * 0.5)))
                                    + Integer.parseInt(String.valueOf(Math.round(examScoreExcel.getLearnGrade() * 0.5))));
                            }else {
                                examScore.setAllGrade(Math.round(examScoreExcel.getLearnGrade() / 2));
                            }
                        }
                        //内网同步
@@ -321,13 +338,21 @@
                            "update exam_score set learn_grade = " + "'" + examScore.getLearnGrade() + "'" +
                                ",all_grade = " + "'" + examScore.getAllGrade() + "'" +
                                ",qualified = " + "'" + examScore.getQualified() + "'" +
                                " " +"where id = " + "'" + examScore.getId() + "'";
                                " " + "where id = " + "'" + examScore.getId() + "'";
                        FtpUtil.sqlFileUpload(s1);
                        //更新成绩数据
                        baseMapper.updateById(examScore);
                    }else {
                        errorList.add(examScoreExcel.getIdCardNo());
                        status.set(false);
                    }
                }
            });
            //如果所有数据导入有一个异常
            if (!status.get()){
                String errorAccount = StringUtils.join(errorList, "\\\n");
                throw new ServiceException("用户:["+errorAccount+"]实操成绩导入失败!账号与准考证号不匹配!");
            }
        }
    }
src/main/java/org/springblade/modules/exam/vo/ExamScoreVO.java
@@ -64,4 +64,26 @@
     */
    private String examDate;
    /**
     * 性别
     */
    private String sex;
    /**
     * 发证时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date paperTime;
    /**
     * 保安证编号
     */
    private String securityNumber;
    /**
     * 头像
     */
    private String avatar;
}
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -147,49 +147,33 @@
        Dept dept = new Dept();
        //自招保安公司
        if (information.getStats().equals("0")) {
            Long i = 1420222768149966850L;
            dept.setParentId(i);
            dept.setTenantId("000000");
            dept.setDeptName(information.getEnterprisename());
            dept.setParentId(1420222768149966850L);
            dept.setAncestors("0,1420222768149966850");
            dept.setDeptCategory(1);
        }
        //保安培训公司
        if (information.getStats().equals("1")) {
            Long i = 1418458374477549569L;
            dept.setParentId(i);
            dept.setTenantId("000000");
            dept.setDeptName(information.getEnterprisename());
            dept.setParentId(1418458374477549569L);
            dept.setAncestors("0,1418458374477549569");
            dept.setDeptCategory(1);
        }
        //保安服务公司
        if (information.getStats().equals("2")) {
            Long i = 1413470343230877697L;
            dept.setParentId(i);
            dept.setTenantId("000000");
            dept.setDeptName(information.getEnterprisename());
            dept.setParentId(1413470343230877697L);
            dept.setAncestors("0,1413470343230877697");
            dept.setDeptCategory(1);
        }
        //武装守押公司
        if (information.getStats().equals("3")) {
            Long i = 1420222961377357825L;
            dept.setParentId(i);
            dept.setTenantId("000000");
            dept.setDeptName(information.getEnterprisename());
            dept.setParentId(1420222961377357825L);
            dept.setAncestors("0,1420222961377357825");
            dept.setDeptCategory(1);
        }
        //跨区域保安公司
        if (information.getStats().equals("4")) {
            Long i = 1425366663452196865L;
            dept.setParentId(i);
            dept.setTenantId("000000");
            dept.setDeptName(information.getEnterprisename());
            dept.setParentId(1425366663452196865L);
            dept.setAncestors("0,1425366663452196865");
            dept.setDeptCategory(1);
        }
        dept.setTenantId("000000");
        dept.setDeptName(information.getEnterprisename());
        dept.setDeptCategory(1);
        if (iDeptService.submit(dept)) {
            CacheUtil.clear(SYS_CACHE);
            // 返回懒加载树更新节点所需字段
@@ -198,6 +182,8 @@
            String id = kv.get("id").toString();
            information.setDepartmentid(id);
        }
        information.setCreateTime(new Date());
        //公司新增
        boolean status = informationService.save(information);
@@ -218,8 +204,13 @@
            user.setStatus(1);
            user.setIsDeleted(0);
            //分配保安角色
            //如果是本市保安公司,分公司,自招保安公司,分配保安公司管理员角色,如果是培训学校,则分配的是培训公司管理员角色
            Role role = new Role();
            role.setRoleAlias("保安公司管理员");
            if (information.getStats().equals("1")){
                role.setRoleAlias("培训公司管理员");
            }else {
                role.setRoleAlias("保安公司管理员");
            }
            Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
            user.setRoleId(oneRole.getId().toString());
            //插入用户数据
@@ -229,7 +220,8 @@
            //Integer id = information.getId();
            String s = "insert into sys_information(id,creditCode,enterpriseName,representative" +
                        ",registeredCapital,organizationCode,registrationNumber, enterprises, address," +
                        " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell,contacts,contactscell) " +
                        " business,region,registration,industry,departmentid,stats,jurisdiction,representativecell," +
                        "contacts,contactscell,create_time,create_user_id) " +
                        "values(" + "'" + information.getId() + "'" +
                        "," + "'" + information.getCreditcode() + "'" +
                        "," + "'" + information.getEnterprisename() + "'" +
@@ -248,7 +240,9 @@
                        "," + "'" + information.getJurisdiction() + "'" +
                        "," + "'" + information.getRepresentativecell() + "'" +
                        "," + "'" + information.getContacts() + "'" +
                        "," + "'" + information.getContactscell() + "'" + ");" +
                        "," + "'" + information.getContactscell() + "'" +
                        "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(information.getCreateTime()) + "'" +
                        "," + "'" + information.getCreateUserId() + "'" + ");" +
                        "insert into blade_dept(id,parent_id,tenant_id,dept_name,ancestors,dept_category,is_deleted) values(" + "'" + information.getDepartmentid() + "'" + "," + "'" + dept.getParentId() + "'" + ","
                        + "'" + dept.getTenantId() + "'" +
                        "," + "'" + information.getEnterprisename() + "'" +
@@ -342,26 +336,35 @@
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "删除", notes = "传入ids")
    public R remove(String creditcode, String departmentid) throws Exception {
        String[] strArray = creditcode.split(",");
        String[] strArrays = departmentid.split(",");
        for (int i = 0; i < strArray.length; i++) {
            informationService.deleteIn(strArray[i]);
            informationService.deleteSh(strArray[i]);
            informationService.deleteMe(strArray[i]);
            String s1 = "delete from sys_information where creditCode = " + "'" + strArray[i] + "'";
            FtpUtil.sqlFileUpload(s1);
            String s2 = "delete from sys_shareholder where creditCode = " + "'" + strArray[i] + "'";
            FtpUtil.sqlFileUpload(s2);
            String s3 = "delete from sys_member where creditCode = " + "'" + strArray[i] + "'";
            FtpUtil.sqlFileUpload(s3);
        }
        for (int j = 0; j < strArrays.length; j++) {
        List<String> list = Arrays.asList(departmentid.split(","));
        list.forEach(s -> {
            //公司信息删除
            informationService.deleteIn(s);
            //主要管理人员信息删除
            informationService.deleteSh(s);
            //出资人信息删除
            informationService.deleteMe(s);
            //机构删除
            informationService.deleteDept(strArrays[j]);
            String s4 = "delete from blade_dept where id = " + "'" + strArrays[j] + "'";
            informationService.deleteDept(s);
            //当前公司下人员逻辑删除
              informationService.deleteUserByDeptId(s);
            //保安公司信息
            String s1 = "delete from sys_information where departmentid = " + "'" + s + "'";
            FtpUtil.sqlFileUpload(s1);
            //主要管理人
            String s2 = "delete from sys_shareholder where dept_id = " + "'" + s + "'";
            FtpUtil.sqlFileUpload(s2);
            //出资人
            String s3 = "delete from sys_member where dept_id = " + "'" + s + "'";
            FtpUtil.sqlFileUpload(s3);
            //组织机构信息逻辑删除
            String s4 = "update blade_dept set is_deleted  = 1 where id = " + "'" + s + "'";
            FtpUtil.sqlFileUpload(s4);
        }
            //保安公司人员信息删除
            String s5 = "update blade_user set is_deleted  = 1 where dept_id " + "'" + s + "'";
            FtpUtil.sqlFileUpload(s5);
        });
        //返回
        return R.success("删除成功");
    }
src/main/java/org/springblade/modules/information/entity/Information.java
@@ -147,4 +147,19 @@
    private Date ftime;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;
    /**
     * 创建人
     */
    @TableField("create_user_id")
    private String createUserId;
}
src/main/java/org/springblade/modules/information/mapper/InformationMapper.java
@@ -42,12 +42,12 @@
     */
    List<InformationVO> selectInformationPage(IPage<InformationVO> page, @Param("information")InformationVO information);
    void insertIn(@Param("information")Information information);
    void deleteIn(String creditcode);
    void deleteSh(String creditcode);
    void deleteMe(String creditcode);
    void deleteIn(@Param("departmentid")String departmentid);
    void deleteSh(@Param("deptId")String deptId);
    void deleteMe(@Param("deptId")String deptId);
    Map selectCount(String departmentid);
    List<Map<Object,String>> selectInCount();
    void deleteDept(String departmentid);
    void deleteDept(@Param("id") String id);
    List<Map<Object,Object>> selectExtype(String deptid,String jurisdiction);
    List<Map<Object,Object>> selectHold(String deptid,String jurisdiction);
    List<Map<Object,Object>> selectDis(String deptid);
@@ -62,4 +62,10 @@
     */
    List<InformationVO> securityPage(IPage<InformationVO> page, @Param("information") InformationVO information);
    List queryYearKh(@Param("year") String year,@Param("jurisdiction")String jurisdiction,@Param("deptid")String deptid);
    /**
     * 根据deptid 删除用户信息
     * @param deptId
     */
    void deleteUserByDeptId(@Param("deptId") String deptId);
}
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -116,19 +116,18 @@
    </select>
    <delete id="deleteIn">
        delete
        from sys_information
        where creditCode = #{creditcode}
        delete from sys_information
        where departmentid = #{departmentid}
    </delete>
    <delete id="deleteSh">
        delete
        from sys_shareholder
        where creditCode = #{creditcode}
        where dept_id = #{deptId}
    </delete>
    <delete id="deleteMe">
        delete
        from sys_member
        where creditCode = #{creditcode}
        where dept_id = #{deptId}
    </delete>
    <select id="selectCount" resultType="java.util.HashMap">
@@ -165,9 +164,8 @@
    </select>
    <delete id="deleteDept">
        delete
        from blade_dept
        where id = #{departmentid}
        update blade_dept set is_deleted  = 1
        where id = #{id}
    </delete>
    <!--资格审查异常数量-->
@@ -400,4 +398,9 @@
            and sdu.dept_id =#{deptid}
        </if>
    </select>
    <!--根据deptid 删除用户信息-->
    <update id="deleteUserByDeptId">
        update blade_user set is_deleted = 1 where dept_id = #{deptId}
    </update>
</mapper>
src/main/java/org/springblade/modules/information/service/IInformationService.java
@@ -43,10 +43,10 @@
     * @return
     */
    IPage<InformationVO> selectInformationPage(IPage<InformationVO> page, InformationVO information);
    void deleteIn(String creditCode);
    void deleteSh(String creditCode);
    void deleteIn(String departmentid);
    void deleteSh(String deptId);
    void insertIn(Information information);
    void deleteMe(String creditCode);
    void deleteMe(String deptId);
    Map selectCount(String departmentid);
    List<Map<Object,String>> selectInCount();
    void deleteDept(String departmentid);
@@ -73,4 +73,10 @@
     * @return
     */
    void importInfor(List<InforExcel> data, Boolean isCovered);
    /**
     * 根据deptid 删除用户信息
     * @param deptId
     */
    void deleteUserByDeptId(String deptId);
}
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
@@ -70,13 +70,13 @@
    }
    @Override
    public void deleteIn(String creditcode) {
        baseMapper.deleteIn(creditcode);
    public void deleteIn(String departmentid) {
        baseMapper.deleteIn(departmentid);
    }
    @Override
    public void deleteSh(String creditcode) {
        baseMapper.deleteSh(creditcode);
    public void deleteSh(String deptId) {
        baseMapper.deleteSh(deptId);
    }
    @Override
@@ -85,8 +85,8 @@
    }
    @Override
    public void deleteMe(String creditcode) {
        baseMapper.deleteMe(creditcode);
    public void deleteMe(String deptId) {
        baseMapper.deleteMe(deptId);
    }
    @Override
@@ -177,4 +177,13 @@
            }
        });
    }
    /**
     * 根据deptid 删除用户信息
     * @param deptId
     */
    @Override
    public void deleteUserByDeptId(String deptId) {
        baseMapper.deleteUserByDeptId(deptId);
    }
}
src/main/java/org/springblade/modules/location/controller/LiveLocationController.java
@@ -13,6 +13,7 @@
import org.springblade.modules.location.entity.Locus;
import org.springblade.modules.location.service.LiveLocationService;
import org.springblade.modules.location.service.LocusService;
import org.springblade.modules.location.vo.LiveLocationVOTest;
import org.springblade.modules.location.vo.LiveLocationVo;
import org.springblade.modules.location.vo.LocusVo;
import org.springframework.web.bind.annotation.*;
@@ -138,6 +139,93 @@
        return R.status(false);
    }
    /**
     * 实时位置信息新增,同时新增到轨迹表中
     * @param locationVOTest 实时位置信息对象
     */
    @PostMapping("/saveLiveLocationAndLocusAsTest")
    @ApiOperation(value = "新增", notes = "传入liveLocation")
    public R saveLiveLocationAndLocusAsTest(@RequestBody LiveLocationVOTest locationVOTest) {
        //获取数据
        LiveLocation liveLocation = new LiveLocation();
        liveLocation.setLongitude(locationVOTest.getLongitude().toString());
        liveLocation.setLatitude(locationVOTest.getLatitude().toString());
        liveLocation.setType(2);
        liveLocation.setWorkerId(16L);
        //先查询是否已有实时位置信息,如果有,则更新,没有则插入
        LiveLocation liveLocationInfo = liveLocationService.getLiveLocationInfo(liveLocation);
        boolean status = false;
        if (null == liveLocationInfo){
            //新增
            liveLocation.setRecordTime(new Date());
            status = liveLocationService.save(liveLocation);
            //数据推送
            String s1 =
                "insert into sys_live_location(id,type,worker_id,longitude,latitude,record_time,location) " +
                    "values(" + "'" + liveLocation.getId() + "'" + "," +
                    "'" + liveLocation.getType() + "'" + "," +
                    "'" + liveLocation.getWorkerId() + "'" + "," +
                    "'" + liveLocation.getLongitude() + "'" + "," +
                    "'" + liveLocation.getLatitude() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" + "," +
                    "'" +liveLocation.getLocation() + "'" + ")";
            FtpUtil.sqlFileUpload(s1);
        }else {
            //更新
            liveLocationInfo.setRecordTime(new Date());
            liveLocationInfo.setLongitude(liveLocation.getLongitude());
            liveLocationInfo.setLatitude(liveLocation.getLatitude());
            status = liveLocationService.updateById(liveLocationInfo);
            //内网同步
            String s1 =
                "update sys_live_location set type = " + "'" + liveLocation.getType() + "'" +
                    ",worker_id = " + "'" + liveLocation.getWorkerId() + "'" +
                    ",longitude = " + "'" + liveLocation.getLongitude() + "'" +
                    ",latitude = " + "'" + liveLocation.getLatitude() + "'" +
                    ",record_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(liveLocation.getRecordTime()) + "'" +
                    ",location = " + "'" + liveLocation.getLocation() + "'" +
                    " " +"where id = " + "'" + liveLocation.getId() + "'";
            FtpUtil.sqlFileUpload(s1);
        }
        if (status){
            //新增轨迹
            Locus locus = new Locus();
            //封装数据
            if (null!=liveLocationInfo){
                locus.setLiveLocationId(liveLocationInfo.getId());
            }else {
                locus.setLiveLocationId(liveLocation.getId());
            }
            if (null!= liveLocation.getLatitude() && null!=liveLocation.getLongitude()){
                locus.setLatitude(liveLocation.getLatitude());
                locus.setLongitude(liveLocation.getLongitude());
            }
            locus.setRecordTime(new Date());
            //新增轨迹
            boolean save1 = locusService.save(locus);
            //数据推送
            String s2 =
                "insert into sys_locus(id,live_location_id,record_time,longitude,latitude) " +
                    "values(" + "'" + locus.getId() + "'" + "," +
                    "'" + locus.getLiveLocationId() + "'" + "," +
                    "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(locus.getRecordTime()) + "'" + "," +
                    "'" + locus.getLongitude() + "'" + "," +
                    "'" +locus.getLatitude() + "'" + ")";
            FtpUtil.sqlFileUpload(s2);
            if (save1){
                //返回数据
                return R.status(true);
            }
        }
        //返回数据
        return R.status(false);
    }
    /**
     * 修改
     * @param liveLocation 实时位置信息对象
src/main/java/org/springblade/modules/location/vo/LiveLocationVOTest.java
New file
@@ -0,0 +1,42 @@
package org.springblade.modules.location.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.io.Serializable;
/**
 * 实时位置测试vo
 * @author zhongrj
 * @since 2021-10-26
 */
@Data
public class LiveLocationVOTest implements Serializable {
    private static final long serialVersionUID = 1L;
    @JsonProperty("AlarmTime")
    private String AlarmTime;
    @JsonProperty("ContactId")
    private String ContactId;
    @JsonProperty("ChannelId")
    private String ChannelId;
    @JsonProperty("AlarmPriority")
    private String AlarmPriority;
    @JsonProperty("AlarmMethod")
    private String AlarmMethod;
    @JsonProperty("AlarmDescription")
    private String AlarmDescription;
    @JsonProperty("Longitude")
    private Double Longitude;
    @JsonProperty("Latitude")
    private Double Latitude;
}
src/main/java/org/springblade/modules/seinspect/mapper/SeinspectMapper.xml
@@ -23,10 +23,11 @@
    <select id="selectSeinspectPage" resultType="org.springblade.modules.seinspect.vo.SeinspectVO">
        select
            ss.*,
            ss.*,bu1.cardid cardId,
            bu.real_name realName,
            bd.dept_name examinerDeptName,
            bu1.real_name securityName
            bu1.real_name securityName,
            bd1.dept_name securityDeptName
        from
            sys_seinspect ss
        left join
@@ -41,18 +42,22 @@
        blade_user bu1
        on
        bu1.id = ss.security_id
        left join
        blade_dept bd1
        on
        bd1.id = bu1.dept_id
        where 1 = 1
        <if test="seinspect.realName!=null and seinspect.realName!=''">
            bu.real_name like concat('%',#{seinspect.realName},'%')
            and bu.real_name like concat('%',#{seinspect.realName},'%')
        </if>
        <if test="seinspect.examinerDeptName!=null and seinspect.examinerDeptName!=''">
            bd.dept_name like concat('%',#{seinspect.examinerDeptName},'%')
            and bd.dept_name like concat('%',#{seinspect.examinerDeptName},'%')
        </if>
        <if test="seinspect.securityName!=null and seinspect.securityName!=''">
            bu1.real_name like concat('%',#{seinspect.securityName},'%')
            and bu1.real_name like concat('%',#{seinspect.securityName},'%')
        </if>
        <if test="seinspect.result!=null and seinspect.result!=''">
            ss.result like concat('%',#{seinspect.result},'%')
            and ss.result like concat('%',#{seinspect.result},'%')
        </if>
    </select>
src/main/java/org/springblade/modules/seinspect/vo/SeinspectVO.java
@@ -53,4 +53,14 @@
     */
    private String reviewedDeptName;
    /**
     * 被检查人单位名称
     */
    private String securityDeptName;
    /**
     * 身份证号码
     */
    private String cardId;
}
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -242,6 +242,14 @@
            rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
        }
        String paperTime;
        //发证日期处理
        if (user.getPaperTime() == null) {
            paperTime = null;
        } else {
            paperTime = new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime());
        }
        String s1 =
            "update blade_user set account = " + "'" + user.getAccount() + "'"
                + ",name = " + "'" + user.getName() + "'"
@@ -262,6 +270,7 @@
                + ",address = " + "'" + user.getAddress() + "'"
                + ",registered = " + "'" + user.getRegistered() + "'"
                + ",rtime = " + "'" + rtime + "'"
                + ",paper_time = " + "'" + paperTime + "'"
                + ",securitynumber = " + "'" + user.getSecuritynumber() + "'"
                + ",hold = " + "'" + user.getHold() + "'"
                + ",jurisdiction = " + "'" + user.getJurisdiction() + "'"
@@ -627,10 +636,17 @@
        //用户新增
        boolean status = userService.save(user);
        String rtime;
        String paperTime;
        if (user.getRtime() == null) {
            rtime = null;
        } else {
            rtime = new SimpleDateFormat("yyyy-MM-dd").format(user.getRtime());
        }
        //发证日期处理
        if (user.getPaperTime() == null) {
            paperTime = null;
        } else {
            paperTime = new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime());
        }
        //头像
        if (null!=user.getAvatar() && !user.getAvatar().equals("")) {
@@ -643,7 +659,7 @@
        }
        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,examination_type,status,is_deleted,dispatch) " +
            "politicaloutlook,healstats,height,address,registered,paper_time,rtime,securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch) " +
            "values(" + "'" + user.getId() + "'" +
            "," + "'" + user.getTenantId() + "'" +
            "," + "'" + user.getAccount() + "'" +
@@ -666,6 +682,7 @@
            + "," + "'" + user.getHeight() + "'" +
            "," + "'" + user.getAddress() + "'" +
            "," + "'" + user.getRegistered() + "'" + "," +
            "'" + paperTime + "'" +
            "'" + rtime + "'" +
            "," + "'" + user.getSecuritynumber() + "'" +
            "," + "'" + user.getHold() + "'" +
src/main/java/org/springblade/modules/system/entity/Dept.java
@@ -16,17 +16,17 @@
 */
package org.springblade.modules.system.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
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;
/**
 * 实体类
@@ -105,4 +105,5 @@
    private Integer isDeleted;
}
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -207,7 +207,7 @@
    <!--通过 身份证号查询用户信息-->
    <select id="getUserInfoByIdCardNo" resultType="org.springblade.modules.system.entity.User">
        SELECT id, name, real_name RealName
        SELECT id, name, real_name RealName,securitynumber
        FROM blade_user
        where 1=1
        and is_deleted = 0
@@ -389,7 +389,11 @@
    <!--计算保安人员年龄-->
    <select id="getUserAgeById" resultType="org.springblade.modules.system.vo.UserVO">
        select id,ifnull(TIMESTAMPDIFF(YEAR, birthday, CURDATE()),0) age from blade_user where id = #{userId}
        select id,ifnull(TIMESTAMPDIFF(YEAR, birthday, CURDATE()),0) age,securitynumber,cardid
        from
        blade_user
        where
        id = #{userId}
    </select>