公司管理和pom文件提交
This commit is contained in:
parent
46fe5363ed
commit
01303d3dc5
5
pom.xml
5
pom.xml
|
|
@ -179,6 +179,11 @@
|
|||
<artifactId>aspectjweaver</artifactId>
|
||||
<version>1.9.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-mapper-asl</artifactId>
|
||||
<version>1.9.13</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,248 @@
|
|||
package com.bonus.leader.performance.manager.corporateOrg.controller;
|
||||
|
||||
|
||||
import com.bonus.leader.performance.manager.corporateOrg.entity.CorporateBean;
|
||||
import com.bonus.leader.performance.manager.corporateOrg.service.CorporateService;
|
||||
import com.bonus.leader.performance.manager.manager.annotation.LogAnnotation;
|
||||
import com.bonus.leader.performance.manager.manager.entity.MapBean;
|
||||
import com.bonus.leader.performance.manager.manager.utils.AjaxRes;
|
||||
import com.bonus.leader.performance.manager.manager.utils.GlobalConst;
|
||||
import com.bonus.leader.performance.manager.manager.utils.R;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 公司管理表控制层
|
||||
* @author jjLV
|
||||
* @Data 2023/11/08 9:30
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("corporate")
|
||||
public class CorporateController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
private static final Logger log = LoggerFactory.getLogger("CareerController");
|
||||
@Resource
|
||||
private CorporateService service;
|
||||
|
||||
/******************************************************公司组织机构公司管理****************************************************************/
|
||||
@LogAnnotation
|
||||
@PostMapping("getFirmContent")
|
||||
@ApiOperation(value = "公司管理-列表")
|
||||
public R getFirmList(CorporateBean o){
|
||||
List<CorporateBean> list = service.getFirmList(o);
|
||||
return list.size() > 0 ? R.okTable(list, list.size()):R.failTable("暂无数据");
|
||||
}
|
||||
|
||||
@RequestMapping(value = "addFirmInfo", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "公司管理-新增")
|
||||
public AjaxRes addFirmInfo(@RequestBody CorporateBean bean) throws Exception {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int cb = service.addFirmInfo(bean);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
if(cb>0){
|
||||
ar.setFailMsg(GlobalConst.INIT_SUCCEED);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getListFirm", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "公司管理-查询人员信息")
|
||||
public AjaxRes getListFirm(String id){
|
||||
AjaxRes ar = new AjaxRes();
|
||||
CorporateBean corporateBean = service.getListFirm(id);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if(corporateBean !=null){
|
||||
map.put("corporateBean",corporateBean);
|
||||
}
|
||||
ar.setSucceed(map,GlobalConst.DATA_SUCCEED);
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "updateFirm", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "公司管理-修改")
|
||||
public AjaxRes updateFirm(@RequestBody CorporateBean bean) throws Exception {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int cb = service.updateFirm(bean);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
if(cb>0){
|
||||
ar.setFailMsg(GlobalConst.INIT_SUCCEED);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "delFirmById", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "公司管理-删除")
|
||||
public AjaxRes delFirmById(String id) throws Exception {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int cb = service.delFirmById(id);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
if(cb>0){
|
||||
ar.setFailMsg(GlobalConst.INIT_SUCCEED);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************公司组织机构分公司管理****************************************************************/
|
||||
@LogAnnotation
|
||||
@PostMapping("getMsgContent")
|
||||
@ApiOperation(value = "分公司管理-列表")
|
||||
public R getList(CorporateBean o){
|
||||
List<CorporateBean> list = service.getList(o);
|
||||
return list.size() > 0 ? R.okTable(list, list.size()):R.failTable("暂无数据");
|
||||
}
|
||||
|
||||
@RequestMapping(value = "addInfo", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "分公司管理-新增")
|
||||
public AjaxRes addInfo(@RequestBody CorporateBean bean) throws Exception {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int cb = service.addInfo(bean);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
if(cb>0){
|
||||
ar.setFailMsg(GlobalConst.INIT_SUCCEED);
|
||||
if (cb == 5){
|
||||
ar.setFailMsg("手机号已存在");
|
||||
}
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getListById", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "分公司管理-查询人员信息")
|
||||
public AjaxRes getListById(String id){
|
||||
AjaxRes ar = new AjaxRes();
|
||||
CorporateBean corporateBean = service.getListById(id);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if(corporateBean !=null){
|
||||
map.put("corporateBean",corporateBean);
|
||||
}
|
||||
ar.setSucceed(map,GlobalConst.DATA_SUCCEED);
|
||||
return ar;
|
||||
}
|
||||
|
||||
@LogAnnotation
|
||||
@PostMapping("switchListen")
|
||||
@ApiOperation(value = "分公司管理-权限锁定")
|
||||
public AjaxRes switchListen(CorporateBean bean) {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int result = service.updateSwitchListen(bean);
|
||||
if(result==1){
|
||||
ar.setSucceedMsg(GlobalConst.DATA_SUCCEED);
|
||||
}else {
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "updateInfo", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "分公司管理-修改")
|
||||
public AjaxRes updateInfo(@RequestBody CorporateBean bean) throws Exception {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int cb = service.updateInfo(bean);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
if(cb>0){
|
||||
ar.setFailMsg(GlobalConst.INIT_SUCCEED);
|
||||
// if (cb == 5){
|
||||
// ar.setFailMsg("手机号已存在");
|
||||
// }
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@LogAnnotation
|
||||
@PostMapping(value = "/getRole")
|
||||
@ApiOperation(value = "分公司管理-公司下拉框")
|
||||
public List<MapBean> getRole() {
|
||||
List<MapBean> result = service.getRole();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************公司组织机构分公司管理****************************************************************/
|
||||
@LogAnnotation
|
||||
@PostMapping("getProjectContent")
|
||||
@ApiOperation(value = "项目部管理-列表")
|
||||
public R getProjectList(CorporateBean o){
|
||||
List<CorporateBean> list = service.getProjectList(o);
|
||||
return list.size() > 0 ? R.okTable(list, list.size()):R.failTable("暂无数据");
|
||||
}
|
||||
|
||||
@LogAnnotation
|
||||
@PostMapping("switchProject")
|
||||
@ApiOperation(value = "项目部管理-权限锁定")
|
||||
public AjaxRes switchProject(CorporateBean bean) {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int result = service.updateswitchProject(bean);
|
||||
if(result==1){
|
||||
ar.setSucceedMsg(GlobalConst.DATA_SUCCEED);
|
||||
}else {
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "addProjectInfo", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "分公司管理-新增")
|
||||
public AjaxRes addProjectInfo(@RequestBody CorporateBean bean) throws Exception {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int cb = service.addProjectInfo(bean);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
if(cb>0){
|
||||
ar.setFailMsg(GlobalConst.INIT_SUCCEED);
|
||||
if (cb == 5){
|
||||
ar.setFailMsg("手机号已存在");
|
||||
}
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getListProject", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "分公司管理-查询人员信息")
|
||||
public AjaxRes getListProject(String id){
|
||||
AjaxRes ar = new AjaxRes();
|
||||
CorporateBean corporateBean = service.getListProject(id);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if(corporateBean !=null){
|
||||
map.put("corporateBean",corporateBean);
|
||||
}
|
||||
ar.setSucceed(map,GlobalConst.DATA_SUCCEED);
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "updateProject", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "分公司管理-修改")
|
||||
public AjaxRes updateProject(@RequestBody CorporateBean bean) throws Exception {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int cb = service.updateProject(bean);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
if(cb>0){
|
||||
ar.setFailMsg(GlobalConst.INIT_SUCCEED);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.bonus.leader.performance.manager.corporateOrg.dao;
|
||||
|
||||
import com.bonus.leader.performance.manager.corporateOrg.entity.CorporateBean;
|
||||
import com.bonus.leader.performance.manager.manager.entity.MapBean;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP登录记录表(AppLoginAudit)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2022-12-12 13:57:37
|
||||
*/
|
||||
@Mapper
|
||||
public interface CorporateDao {
|
||||
List<CorporateBean> getMsgList(CorporateBean o);
|
||||
|
||||
int addInfo(CorporateBean bean);
|
||||
|
||||
CorporateBean getListById(String id);
|
||||
|
||||
int updateSwitchListen(CorporateBean bean);
|
||||
|
||||
int updateInfo(CorporateBean bean);
|
||||
|
||||
List<MapBean> getRole();
|
||||
|
||||
List<CorporateBean> getFirmList(CorporateBean o);
|
||||
|
||||
int addFirmInfo(CorporateBean bean);
|
||||
|
||||
CorporateBean getListFirm(String id);
|
||||
|
||||
int updateFirm(CorporateBean bean);
|
||||
|
||||
List<CorporateBean> getProjectList(CorporateBean o);
|
||||
|
||||
int updateswitchProject(CorporateBean bean);
|
||||
|
||||
int addProjectInfo(CorporateBean bean);
|
||||
|
||||
CorporateBean getListProject(String id);
|
||||
|
||||
int updateProject(CorporateBean bean);
|
||||
|
||||
int delFirmById(String id);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.bonus.leader.performance.manager.corporateOrg.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CorporateBean {
|
||||
private String orgName;
|
||||
private String parentId;
|
||||
private String parentOrgName;
|
||||
private String keyWord;
|
||||
private String value;
|
||||
private String text;
|
||||
private String status;
|
||||
private String id;
|
||||
private String social;
|
||||
private String showAddress;
|
||||
private String msvsName;
|
||||
private String mandates;
|
||||
private String phyTimeStart;
|
||||
private String level;
|
||||
private String orgIds;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.bonus.leader.performance.manager.corporateOrg.service;
|
||||
|
||||
import com.bonus.leader.performance.manager.corporateOrg.entity.CorporateBean;
|
||||
import com.bonus.leader.performance.manager.manager.entity.MapBean;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP登录记录表(AppLoginAudit)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2022-12-12 13:57:37
|
||||
*/
|
||||
@Mapper
|
||||
public interface CorporateService {
|
||||
|
||||
List<CorporateBean> getList(CorporateBean o);
|
||||
|
||||
int addInfo(CorporateBean bean);
|
||||
|
||||
CorporateBean getListById(String id);
|
||||
|
||||
int updateSwitchListen(CorporateBean bean);
|
||||
|
||||
int updateInfo(CorporateBean bean);
|
||||
|
||||
List<MapBean> getRole();
|
||||
|
||||
List<CorporateBean> getFirmList(CorporateBean o);
|
||||
|
||||
int addFirmInfo(CorporateBean bean);
|
||||
|
||||
CorporateBean getListFirm(String id);
|
||||
|
||||
int updateFirm(CorporateBean bean);
|
||||
|
||||
List<CorporateBean> getProjectList(CorporateBean o);
|
||||
|
||||
int updateswitchProject(CorporateBean bean);
|
||||
|
||||
int addProjectInfo(CorporateBean bean);
|
||||
|
||||
CorporateBean getListProject(String id);
|
||||
|
||||
int updateProject(CorporateBean bean);
|
||||
|
||||
int delFirmById(String id);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
package com.bonus.leader.performance.manager.corporateOrg.service;
|
||||
|
||||
|
||||
|
||||
import com.bonus.leader.performance.manager.corporateOrg.dao.CorporateDao;
|
||||
import com.bonus.leader.performance.manager.corporateOrg.entity.CorporateBean;
|
||||
import com.bonus.leader.performance.manager.manager.entity.MapBean;
|
||||
import com.bonus.leader.performance.manager.manager.utils.UserUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* APP登录记录表(AppLoginAudit)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2022-12-12 13:57:46
|
||||
*/
|
||||
@Service("CorporateService")
|
||||
public class CorporateServiceImpl implements CorporateService {
|
||||
@Resource
|
||||
private CorporateDao dao;
|
||||
|
||||
@Override
|
||||
public List<CorporateBean> getList(CorporateBean o) {
|
||||
return dao.getMsgList(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addInfo(CorporateBean bean) {
|
||||
return dao.addInfo(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CorporateBean getListById(String id) {
|
||||
return dao.getListById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSwitchListen(CorporateBean bean) {
|
||||
return dao.updateSwitchListen(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateInfo(CorporateBean bean) {
|
||||
return dao.updateInfo(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MapBean> getRole() {
|
||||
return dao.getRole();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CorporateBean> getFirmList(CorporateBean o) {
|
||||
return dao.getFirmList(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addFirmInfo(CorporateBean bean) {
|
||||
return dao.addFirmInfo(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CorporateBean getListFirm(String id) {
|
||||
return dao.getListFirm(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateFirm(CorporateBean bean) {
|
||||
return dao.updateFirm(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CorporateBean> getProjectList(CorporateBean o) {
|
||||
o.setLevel(UserUtil.getLoginUser().getLevel());
|
||||
o.setOrgIds(UserUtil.getLoginUser().getOrgId());
|
||||
return dao.getProjectList(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateswitchProject(CorporateBean bean) {
|
||||
return dao.updateswitchProject(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addProjectInfo(CorporateBean bean) {
|
||||
return dao.addProjectInfo(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CorporateBean getListProject(String id) {
|
||||
return dao.getListProject(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateProject(CorporateBean bean) {
|
||||
return dao.updateProject(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delFirmById(String id) {
|
||||
return dao.delFirmById(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.bonus.leader.performance.manager.manager.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MapBean {
|
||||
|
||||
private String key;
|
||||
private String value;
|
||||
private String type;
|
||||
private String keyWord;
|
||||
private String checkId;
|
||||
private String higherJob;
|
||||
private String hospitalId;
|
||||
private String phyTimeStart;
|
||||
private String phyTimeEnd;
|
||||
private String reservationTime;
|
||||
private String personName;
|
||||
private String phone;
|
||||
}
|
||||
|
|
@ -21,6 +21,9 @@ public class SysUser extends BaseEntity<Long> {
|
|||
private Integer status;
|
||||
private String intro;
|
||||
|
||||
private String level;
|
||||
private String orgId;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
|
@ -109,6 +112,22 @@ public class SysUser extends BaseEntity<Long> {
|
|||
this.intro = intro;
|
||||
}
|
||||
|
||||
public String getOrgId() {
|
||||
return orgId;
|
||||
}
|
||||
|
||||
public void setOrgId(String orgId) {
|
||||
this.orgId = orgId;
|
||||
}
|
||||
|
||||
public String getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(String level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public interface Status {
|
||||
int DISABLED = 0;
|
||||
int VALID = 1;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,122 @@
|
|||
package com.bonus.leader.performance.manager.manager.utils;
|
||||
|
||||
/**
|
||||
* 全局静态资源
|
||||
*
|
||||
*/
|
||||
public class GlobalConst {
|
||||
|
||||
public static final String SESSION_SECURITY_CODE = "sessionSecCode";
|
||||
|
||||
public static final String SESSION_USER = "sessionUser";
|
||||
|
||||
public static final String SESSION_MENULIST = "sessionMenuList";
|
||||
|
||||
/**
|
||||
* 返回值 没有权限 100
|
||||
*/
|
||||
public static final int NO_AUTHORIZED = 100;
|
||||
|
||||
/**
|
||||
*没有权限返回中文说明
|
||||
*/
|
||||
public static final String NO_AUTHORIZED_MSG="当前角色没有权限";
|
||||
|
||||
/**
|
||||
* 返回值 成功(1)
|
||||
*/
|
||||
public static final int SUCCEED = 1;
|
||||
/**
|
||||
* 返回值 失败(0)
|
||||
*/
|
||||
public static final int FAIL = 0;
|
||||
|
||||
/**
|
||||
*菜单类型 (1)
|
||||
*/
|
||||
public static final String RESOURCES_TYPE_MENU = "1";
|
||||
/**
|
||||
*功能类型(2)
|
||||
*/
|
||||
public static final String RESOURCES_TYPE_FUNCTION = "2";
|
||||
/**
|
||||
*按钮类型(3)
|
||||
*/
|
||||
public static final String RESOURCES_TYPE_BUTTON = "3";
|
||||
|
||||
/**
|
||||
*保存成功
|
||||
*/
|
||||
public static final String SAVE_SUCCEED = "保存成功";
|
||||
/**
|
||||
*发起成功
|
||||
*/
|
||||
public static final String INIT_SUCCEED = "发起成功";
|
||||
/**
|
||||
*保存失败
|
||||
*/
|
||||
public static final String SAVE_FAIL = "保存失败";
|
||||
/**
|
||||
*删除成功
|
||||
*/
|
||||
public static final String DEL_SUCCEED = "删除成功";
|
||||
/**
|
||||
*删除失败
|
||||
*/
|
||||
public static final String DEL_FAIL = "删除失败";
|
||||
/**
|
||||
*修改成功
|
||||
*/
|
||||
public static final String UPDATE_SUCCEED = "修改成功";
|
||||
/**
|
||||
*修改失败
|
||||
*/
|
||||
public static final String UPDATE_FAIL = "修改失败";
|
||||
/**
|
||||
*数据获取成功
|
||||
*/
|
||||
public static final String DATA_SUCCEED = "数据获取成功";
|
||||
/**
|
||||
*设备未完全解绑
|
||||
*/
|
||||
public static final String DATA_UNTIE = "设备未完全解绑";
|
||||
/**
|
||||
*数据获取失败
|
||||
*/
|
||||
public static final String DATA_FAIL = "数据获取失败";
|
||||
/**
|
||||
*上传成功
|
||||
*/
|
||||
public static final String UPLOAD_SUCCEED = "上传成功";
|
||||
/**
|
||||
*上传失败
|
||||
*/
|
||||
public static final String UPLOAD_FAIL = "上传失败";
|
||||
/**
|
||||
*导入成功
|
||||
*/
|
||||
public static final String IMP_SUCCEED = "导入成功";
|
||||
/**
|
||||
*导入失败
|
||||
*/
|
||||
public static final String IMP_FAIL = "导入失败";
|
||||
/**
|
||||
*导入成功
|
||||
*/
|
||||
public static final String GEN_SUCCEED = "生成成功";
|
||||
/**
|
||||
*导入失败
|
||||
*/
|
||||
public static final String GEN_FAIL = "生成失败";
|
||||
|
||||
/**
|
||||
*审核成功
|
||||
*/
|
||||
public static final String AUDIT_SUCCEED = "审核成功";
|
||||
/**
|
||||
*审核失败
|
||||
*/
|
||||
public static final String AUDIT_FAIL = "审核失败";
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
package com.bonus.leader.performance.manager.manager.utils;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 响应信息主体
|
||||
*
|
||||
* @author zys
|
||||
*/
|
||||
public class R<T> implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 成功 */
|
||||
public static final int SUCCESS = 200;
|
||||
|
||||
/** 失败 */
|
||||
public static final int FAIL = 500;
|
||||
|
||||
/** 成功 */
|
||||
public static final int TABLE_FAIL = 1;
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
|
||||
private int count;
|
||||
|
||||
private T data;
|
||||
|
||||
public static <T> R<T> ok()
|
||||
{
|
||||
return restResult(null, SUCCESS, null);
|
||||
}
|
||||
|
||||
public static <T> R<T> ok(T data)
|
||||
{
|
||||
return restResult(data, SUCCESS, null);
|
||||
}
|
||||
|
||||
public static <T> R<T> ok(T data, String msg)
|
||||
{
|
||||
return restResult(data, SUCCESS, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> okTable(T data, int count)
|
||||
{
|
||||
return restTableResult(data, SUCCESS, null, count);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail()
|
||||
{
|
||||
return restResult(null, FAIL, null);
|
||||
}
|
||||
|
||||
public static <T> R<T> failTable()
|
||||
{
|
||||
return restResult(null, FAIL, null);
|
||||
}
|
||||
|
||||
public static <T> R<T> failTable(String msg)
|
||||
{
|
||||
return restTableResult(null, TABLE_FAIL, msg,0);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(String msg)
|
||||
{
|
||||
return restResult(null, FAIL, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(T data)
|
||||
{
|
||||
return restResult(data, FAIL, null);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(T data, String msg)
|
||||
{
|
||||
return restResult(data, FAIL, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(int code, String msg)
|
||||
{
|
||||
return restResult(null, code, msg);
|
||||
}
|
||||
|
||||
private static <T> R<T> restResult(T data, int code, String msg)
|
||||
{
|
||||
R<T> apiResult = new R<>();
|
||||
apiResult.setCode(code);
|
||||
apiResult.setData(data);
|
||||
apiResult.setMsg(msg);
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
private static <T> R<T> restTableResult(T data, int code, String msg, int count)
|
||||
{
|
||||
R<T> apiResult = new R<>();
|
||||
apiResult.setCode(code);
|
||||
apiResult.setCount(count);
|
||||
apiResult.setData(data);
|
||||
apiResult.setMsg(msg);
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
public int getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg()
|
||||
{
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg)
|
||||
{
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getCount()
|
||||
{
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(int count)
|
||||
{
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public T getData()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data)
|
||||
{
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.leader.performance.manager.corporateOrg.dao.CorporateDao">
|
||||
<insert id="addInfo">
|
||||
insert into sys_organization(org_name, parent_id, level, is_active)
|
||||
values(#{orgName}, #{parentId}, '1', '1')
|
||||
</insert>
|
||||
<insert id="addFirmInfo">
|
||||
insert into sys_organization(org_name, social, show_address, msvs_name, mandates, level, is_active)
|
||||
values(#{orgName}, #{social}, #{showAddress}, #{msvsName}, #{phyTimeStart}, '0', '1')
|
||||
</insert>
|
||||
<insert id="addProjectInfo">
|
||||
insert into sys_organization(org_name, parent_id, level, is_active)
|
||||
values(#{orgName}, #{parentId}, '2', '1')
|
||||
</insert>
|
||||
<update id="updateSwitchListen">
|
||||
update sys_organization set is_enable = #{status} where id = #{id}
|
||||
</update>
|
||||
<update id="updateInfo">
|
||||
update sys_organization
|
||||
<set>
|
||||
<if test="orgName != null">
|
||||
org_name = #{orgName},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id = #{parentId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateFirm">
|
||||
update sys_organization
|
||||
<set>
|
||||
<if test="orgName != null">
|
||||
org_name = #{orgName},
|
||||
</if>
|
||||
<if test="social != null">
|
||||
social = #{social},
|
||||
</if>
|
||||
<if test="showAddress != null">
|
||||
show_address = #{showAddress},
|
||||
</if>
|
||||
<if test="msvsName != null">
|
||||
msvs_name = #{msvsName},
|
||||
</if>
|
||||
<if test="phyTimeStart != null">
|
||||
mandates = #{phyTimeStart},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateswitchProject">
|
||||
update sys_organization set is_enable = #{status} where id = #{id}
|
||||
</update>
|
||||
<update id="updateProject">
|
||||
update sys_organization
|
||||
<set>
|
||||
<if test="orgName != null">
|
||||
org_name = #{orgName},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id = #{parentId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="delFirmById">
|
||||
update sys_organization set is_active = '0' where id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="getMsgList"
|
||||
resultType="com.bonus.leader.performance.manager.corporateOrg.entity.CorporateBean">
|
||||
SELECT
|
||||
t1.id AS id,
|
||||
t1.org_name AS orgName,
|
||||
t2.org_name AS parentOrgName,
|
||||
t1.is_enable AS status
|
||||
FROM
|
||||
sys_organization t1
|
||||
LEFT JOIN
|
||||
sys_organization t2 ON t1.parent_id = t2.id
|
||||
WHERE
|
||||
t1.is_active = '1' and t1.level = '1'
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and t1.org_name like concat('%', #{keyWord}, '%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="getListById"
|
||||
resultType="com.bonus.leader.performance.manager.corporateOrg.entity.CorporateBean">
|
||||
SELECT
|
||||
t1.id AS id,
|
||||
t1.org_name AS orgName,
|
||||
t2.org_name AS text,
|
||||
t2.id AS value
|
||||
FROM
|
||||
sys_organization t1
|
||||
LEFT JOIN
|
||||
sys_organization t2 ON t1.parent_id = t2.id
|
||||
WHERE
|
||||
t1.is_active = '1' and t1.id= #{id}
|
||||
</select>
|
||||
<select id="getRole" resultType="com.bonus.leader.performance.manager.manager.entity.MapBean">
|
||||
select id as `key`,org_name as `value` from sys_organization where is_active ='1' and level = '0'
|
||||
</select>
|
||||
<select id="getFirmList"
|
||||
resultType="com.bonus.leader.performance.manager.corporateOrg.entity.CorporateBean">
|
||||
SELECT
|
||||
id AS id,
|
||||
org_name AS orgName,
|
||||
social AS social,
|
||||
show_address AS showAddress,
|
||||
msvs_name AS msvsName,
|
||||
mandates AS mandates
|
||||
FROM sys_organization
|
||||
WHERE is_active = '1' and level = '0'
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
org_name like concat('%', #{keyWord}, '%')
|
||||
or social like concat('%', #{keyWord}, '%')
|
||||
or show_address like concat('%', #{keyWord}, '%')
|
||||
or msvs_name like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
<select id="getListFirm"
|
||||
resultType="com.bonus.leader.performance.manager.corporateOrg.entity.CorporateBean">
|
||||
SELECT
|
||||
id AS id,
|
||||
org_name AS orgName,
|
||||
social AS social,
|
||||
show_address AS showAddress,
|
||||
msvs_name AS msvsName,
|
||||
mandates AS mandates
|
||||
FROM
|
||||
sys_organization
|
||||
WHERE
|
||||
is_active = '1' and id= #{id}
|
||||
</select>
|
||||
<select id="getProjectList"
|
||||
resultType="com.bonus.leader.performance.manager.corporateOrg.entity.CorporateBean">
|
||||
SELECT
|
||||
t1.id AS id,
|
||||
t1.org_name AS orgName,
|
||||
t2.org_name AS parentOrgName,
|
||||
t1.is_enable AS status
|
||||
FROM
|
||||
sys_organization t1
|
||||
LEFT JOIN
|
||||
sys_organization t2 ON t1.parent_id = t2.id
|
||||
WHERE
|
||||
t1.is_active = '1' and t1.level = '2'
|
||||
<if test="level != 0 ">
|
||||
and t2.id = #{orgIds}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and t1.org_name like concat('%', #{keyWord}, '%')
|
||||
</if>
|
||||
<if test="parentId != null and parentId != ''">
|
||||
and t1.parent_id = #{parentId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getListProject"
|
||||
resultType="com.bonus.leader.performance.manager.corporateOrg.entity.CorporateBean">
|
||||
SELECT
|
||||
t1.id AS id,
|
||||
t1.org_name AS orgName,
|
||||
t2.org_name AS text,
|
||||
t2.id AS value
|
||||
FROM
|
||||
sys_organization t1
|
||||
LEFT JOIN
|
||||
sys_organization t2 ON t1.parent_id = t2.id
|
||||
WHERE
|
||||
t1.is_active = '1' and t1.id= #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
var oldKeyWord;
|
||||
var laydate
|
||||
let form
|
||||
var table
|
||||
let pers = checkPermission();
|
||||
layui.use(['table', 'layer', 'laydate', 'jquery', 'form'], function () {
|
||||
table = layui.table;
|
||||
laydate = layui.laydate;
|
||||
form = layui.form;
|
||||
if ($.inArray('sysCompanyManage:add', pers) < 0) {
|
||||
document.getElementById('addDiv').remove();
|
||||
}
|
||||
//渲染table
|
||||
table.render({
|
||||
elem: '#demo'
|
||||
, url: ctxPath + '/corporate/getFirmContent' //数据接口
|
||||
, method: 'post' //方式默认是get
|
||||
, toolbar: 'default' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
|
||||
, where: {} //post请求必须加where ,post请求需要的参数
|
||||
, cellMinWidth: 80
|
||||
, cols: [[ //表头
|
||||
{
|
||||
field: 'number', width:120,title: '序号', align: 'center', type: 'numbers'
|
||||
}
|
||||
, {field: 'orgName', align: 'center', title: '公司名称'}
|
||||
, {field: 'social', align: 'center', title: '统一社会信用代码'}
|
||||
, {field: 'showAddress', align: 'center', title: '注册地址'}
|
||||
, {field: 'msvsName', align: 'center', title: '法定代表人姓名 '}
|
||||
, {field: 'mandates', align: 'center', title: '企业注册日期'}
|
||||
, {
|
||||
fixed: 'right', width:180, title: '操作', align: 'center', templet: d => {
|
||||
let text = "";
|
||||
if ($.inArray('sysCompanyManage:update', pers) >= 0) {
|
||||
text +='<a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 16px">编辑</a>';
|
||||
text +='<span lay-event="com" style="font-size: 15px;"> | </span>';
|
||||
}
|
||||
if ($.inArray('sysCompanyManage:del', pers) >= 0) {
|
||||
text +='<a lay-event="del" style="color: #009688;cursor: pointer;font-size: 16px">删除</a>';
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
]]
|
||||
, id: 'menuTable'
|
||||
, page: true //开启分页
|
||||
, loading: true //数据加载中。。。
|
||||
, limits: [5, 10, 20] //一页选择显示3,5或10条数据
|
||||
, limit: 10 //一页显示5条数据
|
||||
, response: {
|
||||
statusCode: 200 //规定成功的状态码,默认:0
|
||||
}, parseData: function (res) { //将原始数据解析成 table 组件所规定的数据,res为从url中get到的数据
|
||||
let result;
|
||||
if (res.data !== '' && res.data != null && res.data !== "null") {
|
||||
if (this.page.curr) {
|
||||
result = res.data.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr);
|
||||
} else {
|
||||
result = res.data.slice(0, this.limit);
|
||||
}
|
||||
}
|
||||
return {
|
||||
"code": res.code, //解析接口状态
|
||||
"msg": res.msg, //解析提示文本
|
||||
"count": res.count, //解析数据长度
|
||||
"data": result, //解析数据列表
|
||||
};
|
||||
},
|
||||
|
||||
toolbar: "#toolbar"
|
||||
});
|
||||
|
||||
// 行工具事件
|
||||
table.on('tool(test)', function (obj) {
|
||||
var data = obj.data //获得当前行数据
|
||||
var layEvent = obj.event; //获得 lay-event 对应的值
|
||||
var id = data.id
|
||||
if (layEvent === 'edit') {
|
||||
openForm(id,'修改');
|
||||
} else if (layEvent === 'del') {
|
||||
delHospital(id);
|
||||
}
|
||||
});
|
||||
|
||||
//头监听事件 -- checkBox 选中行和选中条数
|
||||
table.on('toolbar(test)', function (obj) {
|
||||
// 获取当前表格被选中的记录对象,返回数据
|
||||
var checkStatus = table.checkStatus(obj.config.id);
|
||||
//获取事件名,执行对应的代码
|
||||
var eventName = obj.event;
|
||||
switch (eventName) {
|
||||
case "searchBt":
|
||||
oldKeyWord = $("#keyWord").val();
|
||||
table.reload('menuTable', {
|
||||
url: ctxPath + '/corporate/getFirmContent'
|
||||
, method: 'post' //方式默认是get
|
||||
, page: true
|
||||
, where: {
|
||||
keyWord: oldKeyWord,
|
||||
} //设定异步数据接口的额外参数
|
||||
});
|
||||
/**二次赋值-- 点击搜索按钮之后会进行一次刷新操作*/
|
||||
$("#keyWord").val(oldKeyWord);
|
||||
break;
|
||||
case "addBtn":
|
||||
openForm("",'新增');
|
||||
break;
|
||||
case "resetBt":
|
||||
oldKeyWord = "";
|
||||
$("#keyWord").val("");
|
||||
table.reload('menuTable', {
|
||||
url: ctxPath + '/corporate/getFirmContent'
|
||||
, method: 'post' //方式默认是get
|
||||
, page: true
|
||||
, where: {
|
||||
keyWord: "",
|
||||
} //设定异步数据接口的额外参数
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增-修改功能
|
||||
*/
|
||||
function openForm(id,title){
|
||||
localStorage.setItem("id",id);
|
||||
layerOpenForm(title,"./addGovernanceFrom.html","70%","85%")
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除功能
|
||||
*/
|
||||
function delHospital(id) {
|
||||
layer.confirm('确定要删除吗?', {
|
||||
btn : [ '确定', '取消' ]
|
||||
}, function() {
|
||||
ajaxCommonMethod('/corporate/delFirmById',{'id': id},"删除成功","删除失败");
|
||||
layer.close(1);
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns="http://www.w3.org/1999/html">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>公司管理--列表查询</title>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../js/layui-v2.9.6/css/layui.css">
|
||||
<style>
|
||||
body {
|
||||
font: 14px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif !important;
|
||||
}
|
||||
.layui-btn-sm {
|
||||
height: 35px;
|
||||
line-height: 30px;
|
||||
padding: 0 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.layui-form-item{
|
||||
margin-left: 0px!important;
|
||||
}
|
||||
.layui-form-item{
|
||||
margin-bottom: 0px!important;
|
||||
}
|
||||
.layui-input, .layui-textarea {
|
||||
display: block;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.layui-form-label {
|
||||
position: relative;
|
||||
float: left;
|
||||
display: block;
|
||||
padding: 12px 15px;
|
||||
width: 80px;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="" onsubmit="return false">
|
||||
</form>
|
||||
|
||||
<div style="margin-left: 15px;margin-right: 15px;">
|
||||
<div class="widget-body">
|
||||
<table id="demo" lay-filter="test" class="layui-table" lay-size="lg">
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<script type="text/javascript" src="../../js/jquery-3.6.0.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script type="text/javascript" src="../../js/layui-v2.9.6/layui.js"></script>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script type="text/javascript" src="../../js/common_methon.js"></script>
|
||||
<script type="text/javascript" src="../../js/dict.js"></script>
|
||||
<script type="text/javascript" src="../../js/my/permission.js"></script>
|
||||
<script type="text/javascript" src="../../js/select.js"></script>
|
||||
<script type="text/javascript" src="../../js/corporateOrg/CorporateGovernance.js"></script>
|
||||
<!--<script type="text/html" id="toolsBar">-->
|
||||
<!-- <a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 16px">编辑</a>-->
|
||||
<!-- <span> | </span>-->
|
||||
<!-- <a lay-event="del" style="color: #009688;cursor: pointer;font-size: 16px">删除</a>-->
|
||||
<!--</script>-->
|
||||
<script type="text/html" id="toolbar">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline" style="width: 10%; margin-top: 4px;">
|
||||
<input type="text" id="keyWord" placeholder="请输入关键字" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-inline" style="margin-top: 4px">
|
||||
<button id="searchBt" class="layui-btn" lay-event="searchBt">查询</button>
|
||||
</div>
|
||||
<div class="layui-inline" style="margin-top: 4px"> 
|
||||
<button id="resetBt" class="layui-btn" lay-event="resetBt">重置</button>
|
||||
</div>
|
||||
<div class="layui-inline" style="margin-top: 4px" id="addDiv">
|
||||
<button id="addBtn" class="layui-btn" lay-event="addBtn" style="margin-left: 16px;">新增</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</script>
|
||||
Loading…
Reference in New Issue