Commit d7d1126b authored by 李腾威's avatar 李腾威

逻辑迁移

parent e64a8656
package com.yeejoin.amos.boot.module.jcs.api.service; package com.yeejoin.amos.boot.module.jcs.api.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue; import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonFormVo; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonVo; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrFormVo; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrVo; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrVo;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import javax.servlet.http.HttpServletRequest;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -135,8 +131,15 @@ public interface IOrgUsrService { ...@@ -135,8 +131,15 @@ public interface IOrgUsrService {
OrgPersonFormVo selectPersonByIdDetail(Long id) throws Exception; OrgPersonFormVo selectPersonByIdDetail(Long id) throws Exception;
List<OrgMenuVo> selectPersonTree() throws Exception; List<OrgMenuVo> selectPersonTree() throws Exception;
void savePersonList (List <OrgPersonVo> OrgPersonVo)throws Exception; void savePersonList (List <OrgPersonVo> OrgPersonVo)throws Exception;
void saveOrgDepartment(OrgDepartmentVo OrgDepartmentVo) throws Exception;
void updateByIdOrgDepartment ( OrgDepartmentVo OrgDepartmentVo,Long id) throws Exception;
OrgDepartmentFormVo selectDepartmentById(Long id) throws Exception;
} }
...@@ -3,18 +3,15 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller; ...@@ -3,18 +3,15 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentFormVo; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -35,7 +32,6 @@ import com.yeejoin.amos.boot.biz.common.constants.CommonConstant; ...@@ -35,7 +32,6 @@ import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.utils.ExcelUtils; import com.yeejoin.amos.boot.biz.common.utils.ExcelUtils;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrDownloadTemplateVO; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrDownloadTemplateVO;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
...@@ -43,7 +39,6 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.OrgUsrServiceImpl; ...@@ -43,7 +39,6 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.OrgUsrServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
/** /**
* @author fengwang * @author fengwang
...@@ -66,11 +61,8 @@ public class OrgDepartmentController { ...@@ -66,11 +61,8 @@ public class OrgDepartmentController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST) @RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增部门信息", notes = "新增部门信息") @ApiOperation(httpMethod = "POST", value = "新增部门信息", notes = "新增部门信息")
public ResponseModel<Object> saveOrgUsr(HttpServletRequest request, @RequestBody OrgDepartmentVo OrgDepartmentVo) { public ResponseModel<Object> saveOrgUsr(HttpServletRequest request, @RequestBody OrgDepartmentVo OrgDepartmentVo) throws Exception {
OrgUsr orgUsr = new OrgUsr(); iOrgUsrService.saveOrgDepartment(OrgDepartmentVo);
BeanUtils.copyProperties(OrgDepartmentVo, orgUsr);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_DEPARTMENT);
iOrgUsrService.saveOrgUsrAlertFormValue(orgUsr,OrgDepartmentVo.getAlertFormValue());
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
...@@ -99,13 +91,7 @@ public class OrgDepartmentController { ...@@ -99,13 +91,7 @@ public class OrgDepartmentController {
@RequestMapping(value = "/{id}", method = RequestMethod.PUT) @RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "更新部门数据", notes = "更新部门数据") @ApiOperation(httpMethod = "PUT", value = "更新部门数据", notes = "更新部门数据")
public ResponseModel<Object> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgDepartmentVo OrgDepartmentVo, @PathVariable Long id) throws Exception { public ResponseModel<Object> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgDepartmentVo OrgDepartmentVo, @PathVariable Long id) throws Exception {
// 修改部门信息 iOrgUsrService.updateByIdOrgDepartment(OrgDepartmentVo, id);
OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = iOrgUsrService.getById(id);
BeanUtils.copyProperties(OrgDepartmentVo, orgUsr);
iOrgUsrService.saveOrgUsr(oriOrgUsr,id);
// 保存动态表单数据
iOrgUsrService.updateAlertFormValue(oriOrgUsr,orgUsr.getSequenceNbr(),OrgDepartmentVo.getAlertFormValue());
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
...@@ -120,30 +106,7 @@ public class OrgDepartmentController { ...@@ -120,30 +106,7 @@ public class OrgDepartmentController {
@RequestMapping(value = "/{id}", method = RequestMethod.GET) @RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取部门详情", notes = "获取部门详情") @ApiOperation(httpMethod = "GET", value = "获取部门详情", notes = "获取部门详情")
public ResponseModel<OrgDepartmentFormVo> selectById(HttpServletRequest request, @PathVariable Long id) throws Exception { public ResponseModel<OrgDepartmentFormVo> selectById(HttpServletRequest request, @PathVariable Long id) throws Exception {
OrgUsr orgUsr = iOrgUsrService.getById(id); return ResponseHelper.buildResponse(iOrgUsrService.selectDepartmentById(id));
// 动态表单数据
List<FormValue> formValue = iOrgUsrService.getFormValue(id);
OrgDepartmentFormVo orgDepartmentFormVo = new OrgDepartmentFormVo(formValue);
BeanUtils.copyProperties(orgUsr, orgDepartmentFormVo);
return ResponseHelper.buildResponse(orgDepartmentFormVo);
}
/**
* 获取部门树
*
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取部门树", notes = "获取部门树")
public ResponseModel<List<OrgMenuVo>> selectCompanyTree() throws Exception {
Map<String, Object> columnMap = new HashMap<>();
columnMap.put("is_delete", CommonConstant.IS_DELETE_00);
columnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_DEPARTMENT);
Collection<OrgUsr> list = iOrgUsrService.listByMap(columnMap);
List<OrgMenuVo> menus = iOrgUsrService.getTree(null, list, OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", "getBizOrgType");
return ResponseHelper.buildResponse(menus);
} }
......
...@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller; ...@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -26,8 +25,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; ...@@ -26,8 +25,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant; import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.utils.ExcelUtils; import com.yeejoin.amos.boot.biz.common.utils.ExcelUtils;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonVo; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrDownloadTemplateVO; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrDownloadTemplateVO;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
...@@ -35,7 +33,6 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.OrgUsrServiceImpl; ...@@ -35,7 +33,6 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.OrgUsrServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
/** /**
* @author fengwang * @author fengwang
......
...@@ -15,6 +15,7 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.OrgUsrMapper; ...@@ -15,6 +15,7 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IOrgUsrService; import com.yeejoin.amos.boot.module.jcs.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo; import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue; import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonFormVo; import com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonFormVo;
...@@ -27,10 +28,8 @@ import org.typroject.tyboot.core.foundation.utils.Bean; ...@@ -27,10 +28,8 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -538,4 +537,33 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -538,4 +537,33 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
saveOrgUsrAlertFormValue(orgUsr,OrgPersonVo.get(i).getAlertFormValue()); saveOrgUsrAlertFormValue(orgUsr,OrgPersonVo.get(i).getAlertFormValue());
} }
} }
@Override
public void saveOrgDepartment(OrgDepartmentVo OrgDepartmentVo) throws Exception {
OrgUsr orgUsr = new OrgUsr();
BeanUtils.copyProperties(OrgDepartmentVo, orgUsr);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_DEPARTMENT);
saveOrgUsrAlertFormValue(orgUsr,OrgDepartmentVo.getAlertFormValue());
}
@Override
public void updateByIdOrgDepartment(OrgDepartmentVo OrgDepartmentVo, Long id) throws Exception {
// 修改部门信息
OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgDepartmentVo, orgUsr);
saveOrgUsr(oriOrgUsr,id);
// 保存动态表单数据
updateAlertFormValue(oriOrgUsr,orgUsr.getSequenceNbr(),OrgDepartmentVo.getAlertFormValue());
}
@Override
public OrgDepartmentFormVo selectDepartmentById(Long id) throws Exception {
OrgUsr orgUsr = getById(id);
// 动态表单数据
List<FormValue> formValue = getFormValue(id);
OrgDepartmentFormVo orgDepartmentFormVo = new OrgDepartmentFormVo(formValue);
BeanUtils.copyProperties(orgUsr, orgDepartmentFormVo);
return orgDepartmentFormVo;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment