| | |
| | | import com.example.server.teamGroup.service.SysTeamGroupClassService; |
| | | import com.example.server.user.model.SysUser; |
| | | import com.example.server.user.service.UserService; |
| | | import com.example.server.utils.UserAndSiteUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | JLabel JLabel0 = new JLabel("类型"); |
| | | JComboBox<String> comboBox1 = new JComboBox<>(typeList); |
| | | comboBox1.setPreferredSize(new Dimension(185,28)); |
| | | comboBox1.setPreferredSize(new Dimension(185, 28)); |
| | | if (StringUtils.isNotBlank(data.getType())) { |
| | | comboBox1.setSelectedItem(data.getType()); |
| | | } |
| | |
| | | |
| | | JLabel JLabel4 = new JLabel("所属部门"); |
| | | JComboBox<JComboBoxItem> comboBox2 = new JComboBox<>(deptList); |
| | | comboBox2.setPreferredSize(new Dimension(185,28)); |
| | | comboBox2.setPreferredSize(new Dimension(185, 28)); |
| | | if (data.getPid() != null) { |
| | | if (data.getPid()!=0){ |
| | | if (data.getPid() != 0) { |
| | | comboBox2.setSelectedItem(BoxIteUtils.GetSelectItemById(deptList, data.getPid())); |
| | | }else { |
| | | } else { |
| | | comboBox2.setEditable(false); |
| | | } |
| | | } |
| | |
| | | saveButton.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | SysUser user = (SysUser) UserAndSiteUtils.get("user", "user"); |
| | | if (user == null) { |
| | | JOptionPane.showMessageDialog(null, "用户失效请退出并重新登录", "提示", JOptionPane.WARNING_MESSAGE); |
| | | return; |
| | | } |
| | | String type = comboBox1.getSelectedItem().toString(); |
| | | JComboBoxItem dept = (JComboBoxItem) comboBox2.getSelectedItem(); |
| | | Integer sortMax = 0; |
| | | if (type.equals("部门")) { |
| | | data.setPid(0L); |
| | | sortMax = sysTeamGroupClassService.getSortMax(0L); |
| | | if (sortMax == null) { |
| | | sortMax = 100; |
| | | } |
| | | data.setSort(sortMax + 100); |
| | | } else { |
| | | data.setPid(dept.getId()); |
| | | sortMax = sysTeamGroupClassService.getSortMax(dept.getId()); |
| | | sortMax = sysTeamGroupClassService.getSortMax(dept.getId()) == null ? 0 : sysTeamGroupClassService.getSortMax(dept.getId()); |
| | | data.setSort(sortMax + 1); |
| | | } |
| | | |
| | |
| | | |
| | | sysTeamGroupClassService.save(data); |
| | | |
| | | List<SysTeamGroupClass> list = sysTeamGroupClassService.getListByTree();; |
| | | List<SysTeamGroupClass> list = sysTeamGroupClassService.getListByTree(); |
| | | ; |
| | | CommonTable.refreshTable(list, columnDto, table); |
| | | teamGroupManageService.tableModelListener(table, jFrame, list); |
| | | frame1.dispose(); |
| | | jFrame.setEnabled(true);//将主界面再设置为可操作的 |
| | | JOptionPane.showMessageDialog(null, "保存成功", "提示", JOptionPane.WARNING_MESSAGE); |
| | | } |
| | | }); |
| | | |