1.派遣保安员列表接口修改,去除已派遣的人员
2.派遣单位新增创建时间
| | |
| | | <if test="dispatcher.name!=null and dispatcher.name!=''"> |
| | | and sd.name like concat('%', #{dispatcher.name},'%') |
| | | </if> |
| | | <if test="dispatcher.securityName!=null and dispatcher.securityName!=''"> |
| | | and bu.real_name like concat('%', #{dispatcher.securityName},'%') |
| | | </if> |
| | | <if test="dispatcher.cardid!=null and dispatcher.cardid!=''"> |
| | | and sd.cardid like concat('%', #{dispatcher.cardid},'%') |
| | | </if> |
| | |
| | | // } |
| | | // } |
| | | |
| | | dispatcherUnit.setCreateTime(new Date()); |
| | | |
| | | //新增 |
| | | this.save(dispatcherUnit); |
| | | |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_dispatcher_unit(id,name,dept_id,linkman,phone,start_time,end_time) " + |
| | | "insert into sys_dispatcher_unit(id,name,dept_id,linkman,phone,create_time,start_time,end_time) " + |
| | | "values(" + "'" + dispatcherUnit.getId() + "'" + "," + |
| | | "'" + dispatcherUnit.getName() + "'" + "," + |
| | | "'" + dispatcherUnit.getDeptId() + "'" + "," + |
| | | "'" + dispatcherUnit.getLinkman() + "'" + "," + |
| | | "'" + dispatcherUnit.getPhone() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(dispatcherUnit.getCreateTime()) + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy/MM/dd").format(dispatcherUnit.getStartTime()) + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy/MM/dd").format(dispatcherUnit.getEndTime()) + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | |
| | | and bd.is_deleted = 0 |
| | | and bd.id = #{user.deptId} |
| | | and br.role_alias = '保安' |
| | | and bu.dispatch = 1 |
| | | ) |
| | | </select> |
| | | |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | |
| | | tree.add(treeNode); |
| | | } |
| | | }); |
| | | //将原有的保安员加入到集合 |
| | | if (null!=user.getId()){ |
| | | TreeNode treeNode = new TreeNode(); |
| | | treeNode.setId(user.getId()); |
| | | treeNode.setHasChildren(false); |
| | | treeNode.setName(user.getRealName()); |
| | | treeNode.setParentId(Long.parseLong(user.getDeptId())); |
| | | tree.get(0).getChildren().add(treeNode); |
| | | } |
| | | } |
| | | //获取子节点 |
| | | List<TreeNode> children = tree.get(0).getChildren(); |
| | | //排序 |
| | | List<TreeNode> nodes = children.stream().sorted(Comparator.comparing(TreeNode::getId)).collect(Collectors.toList()); |
| | | //设置排序后的集合 |
| | | tree.get(0).setChildren(nodes); |
| | | //返回 |
| | | return tree; |
| | | } |
| | | |