Commit 58127b81 by Java-曹文达

解决问题

parent 770b71a7
......@@ -158,9 +158,9 @@ public class UserApiController {
**/
@PostMapping("addOrganizationMember")
@ResponseBody
public Result addOrganizationMember(String name, String position, Long pId, Integer id,Integer department,Integer type){
public Result addOrganizationMember(String name, String position, Long pId, Integer id,Integer department,Integer type,String userCode){
//获取session中的值
Result result = userInfoService.addOrganizationMember(name,position,pId,id,department,type);
Result result = userInfoService.addOrganizationMember(name,position,pId,id,department,type,userCode);
return result;
}
......
......@@ -43,15 +43,16 @@ public interface UserInfoService {
* @Author:cwd
* @Description:添加部门人员
* @Date: 2019/03/04 22:53
* @param id
* @param name
* @param position
* @param pId
* @param id
* @param department
* @param position
* @param type
* @param userCode
* @return Result
**/
Result addOrganizationMember(String name, String position, Long pId, Integer id, Integer department, Integer type);
Result addOrganizationMember(String name, String position, Long pId, Integer id, Integer department, Integer type, String userCode);
/**
* 获取组织列表
* @Author:cwd
......
......@@ -20,7 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
......@@ -154,16 +153,17 @@ public class UserInfoServiceImpl implements UserInfoService{
* @Author:cwd
* @Description:添加部门人员
* @Date: 2019/03/04 22:53
* @param id
* @param name
* @param position
* @param pId
* @param id
* @param department
* @param position
* @param type
* @param userCode
* @return Result
**/
@Override
public Result addOrganizationMember(String name, String position, Long pId, Integer id, Integer department, Integer type) {
public Result addOrganizationMember(String name, String position, Long pId, Integer id, Integer department, Integer type, String userCode) {
try {
BpmEmployee bpmEmployee=new BpmEmployee();
bpmEmployee.setCreateTime(new Date());
......@@ -179,6 +179,7 @@ public class UserInfoServiceImpl implements UserInfoService{
}
bpmEmployee.setPosition(position);
bpmEmployee.setStatus(0);
bpmEmployee.setUserCode(userCode);
memberMapper.insert(bpmEmployee);
return ResultUtil.getResult(RespCode.Code.SUCCESS);
}catch (Exception e){
......
......@@ -431,8 +431,6 @@
var abbreviationName = $("[name='abbreviationName']").val();
if (name==''){
layer.msg("组织名称不能为空");
}else if (abbreviationName==''){
layer.msg("组织简写不可为空");
}else {
$.post(
"/bpm/user/editOrganization",
......@@ -533,10 +531,12 @@
}else if (pId==1&& type==2){
var content = '<div style="margin-top: 13px;margin-left: 27px;"><span ><b>人员名称:</b><input type="text" value="" placeholder="请输入人员名称" name="oName" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px;margin-left: 16px;"/></span><br>\n' +
'\t\t<br><span ><b>所在部门:</b><select name="areaId" id="areaId" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px;margin-left: 16px;width: 159px;"></select></span><br>\n' +
'\t\t<br><span ><b style="margin-top: 10px">人员code:</b><input type="text" value="" placeholder="请输入人员code" name="userCode" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px; margin-left: 16px;"/></span><br>\n'+
'\t\t<br><span ><b style="margin-left: 28px;margin-top: 10px">职位:</b><input type="text" value="" placeholder="请输入职位" name="position" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px; margin-left: 16px;"/></span><br>\n';
}
else {
var content = '<div style="margin-bottom: 45px;margin-top: 13px;margin-left: 27px;"><span ><b>人员名称:</b><input type="text" value="" placeholder="请输入人员名称" name="oName" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px;margin-left: 16px;"/></span><br>\n' +
'\t\t<br><span ><b style="margin-top: 10px">用户code:</b><input type="text" value="" placeholder="请输入code" name="userCode" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px; margin-left: 16px;"/></span><br>\n'+
'\t\t<br><span ><b style="margin-left: 28px;margin-top: 10px">职位:</b><input type="text" value="" placeholder="请输入职位" name="position" style="color: black;height: 30px;border: 1px solid #EEEEEE;text-indent: 5px; margin-left: 16px;"/></span><br>\n';
}
//联系方式验证规则
......@@ -619,11 +619,14 @@
var name = $("[name='oName']").val();
var position = $("[name='position']").val();
var areaId = $("[name='areaId']").val();
var userCode = $("[name='userCode']").val();
if (name==''){
layer.msg("人员名称不能为空");
}else if (position==''){
layer.msg("职位");
}else {
layer.msg("职位不可为空");
}else if (userCode==''){
layer.msg("userCode不可为空");
}else {
$.post(
"/bpm/user/addOrganizationMember",
{
......@@ -632,7 +635,8 @@
"name":name,
"position":position,
"pId":pId,
"id":id
"id":id,
"userCode":userCode
},
function (data) {
if (data.code==200){
......@@ -663,14 +667,18 @@
btn1: function (index,layero) {
var name = $("[name='oName']").val();
var position = $("[name='position']").val();
var userCode = $("[name='userCode']").val();
if (name==''){
layer.msg("人员名称不能为空");
}else if (position==''){
layer.msg("职位");
layer.msg("职位不可为空");
}else if (userCode==''){
layer.msg("userCode不可为空");
}else {
$.post(
"/bpm/user/addOrganizationMember",
{
"userCode":userCode,
"name":name,
"position":position,
"pId":pId,
......
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