Преглед изворни кода

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/webapp/webpage/modules/signatureManagement/electronicSignature/ElectronicSignatureList.jsp
sangwenwei пре 1 година
родитељ
комит
334b792a82

+ 20 - 2
src/main/java/com/jeeplus/modules/areaStaff/dao/AreaStaffDao.java

@@ -3,6 +3,7 @@ package com.jeeplus.modules.areaStaff.dao;
 import com.jeeplus.common.persistence.TreeDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
 import com.jeeplus.modules.areaStaff.entity.AreaStaffInfo;
+import com.jeeplus.modules.areaStaff.entity.AreaStaffUserInfo;
 import com.jeeplus.modules.sys.entity.Menu;
 import com.jeeplus.modules.sys.entity.User;
 import org.apache.ibatis.annotations.Param;
@@ -49,7 +50,7 @@ public interface AreaStaffDao extends TreeDao<AreaStaffInfo> {
 
     List<User> getUserByParentIdAndStandardDetail(AreaStaffInfo info);
 
-    Boolean outUserById(@Param("userId")String userId, @Param("parentId")String parentId);
+    Boolean outUserById(@Param("userId")String userId, @Param("id")String id);
 
     /**
      * 删除所有子节点信息(逻辑删除)
@@ -61,7 +62,24 @@ public interface AreaStaffDao extends TreeDao<AreaStaffInfo> {
 
     List<AreaStaffInfo> getAreaStaffInfoByParentIdAndStandardDetail(@Param("standardDetail")String standardDetail, @Param("parentId")String parentId);
 
-    List<AreaStaffInfo> getAreaStaffInfoByParentIdAndType(@Param("type")String type, @Param("parentId")String parentId);
+    List<AreaStaffInfo> getAreaStaffInfoByParentIdAndAreaManagement(@Param("areaManagement")String areaManagement, @Param("parentId")String parentId);
 
     AreaStaffInfo getMasterStateByUserId(String userId);
+
+    /**
+     * 查询该地区下是否存在该成员信息
+     * @param areaStaffUserInfo
+     * @return
+     */
+    Integer getExistsUser(AreaStaffUserInfo areaStaffUserInfo);
+
+    /**
+     * 新增人员信息
+     * @param areaStaffUserInfo
+     * @return
+     */
+    void insertAreaStaffUser(AreaStaffUserInfo areaStaffUserInfo);
+
+
+    List<AreaStaffInfo> getUserListByIdList(@Param("idList") List<String> idList);
 }

+ 28 - 0
src/main/java/com/jeeplus/modules/areaStaff/entity/AreaStaffInfo.java

@@ -26,6 +26,10 @@ public class AreaStaffInfo extends TreeEntity<AreaStaffInfo> {
     private Integer proofread; //是否是校核
     private String hierarchy; //节点所属层级
 
+    private String areaManagement;  //管理地区(手动输入文本)
+    private String areaLeaderId;  //地区责任人id
+    private String leaderName;  //地区责任人名称
+
 
     private String number;    //编号
     private String name;      //名称
@@ -173,4 +177,28 @@ public class AreaStaffInfo extends TreeEntity<AreaStaffInfo> {
     public void setStandardDetailStr(String standardDetailStr) {
         this.standardDetailStr = standardDetailStr;
     }
+
+    public String getAreaManagement() {
+        return areaManagement;
+    }
+
+    public void setAreaManagement(String areaManagement) {
+        this.areaManagement = areaManagement;
+    }
+
+    public String getAreaLeaderId() {
+        return areaLeaderId;
+    }
+
+    public void setAreaLeaderId(String areaLeaderId) {
+        this.areaLeaderId = areaLeaderId;
+    }
+
+    public String getLeaderName() {
+        return leaderName;
+    }
+
+    public void setLeaderName(String leaderName) {
+        this.leaderName = leaderName;
+    }
 }

+ 37 - 0
src/main/java/com/jeeplus/modules/areaStaff/entity/AreaStaffUserInfo.java

@@ -0,0 +1,37 @@
+package com.jeeplus.modules.areaStaff.entity;
+
+import com.jeeplus.common.persistence.DataEntity;
+
+/**
+ * @author: 徐滕
+ * @version: 2024-06-21 10:52
+ */
+public class AreaStaffUserInfo extends DataEntity<AreaStaffUserInfo> {
+    private String areaStaffId;
+    private String userId;
+    private String userName;
+
+    public String getAreaStaffId() {
+        return areaStaffId;
+    }
+
+    public void setAreaStaffId(String areaStaffId) {
+        this.areaStaffId = areaStaffId;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+}

+ 66 - 92
src/main/java/com/jeeplus/modules/areaStaff/service/AreaStaffService.java

@@ -6,6 +6,7 @@ import com.jeeplus.common.service.TreeService;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.modules.areaStaff.dao.AreaStaffDao;
 import com.jeeplus.modules.areaStaff.entity.AreaStaffInfo;
+import com.jeeplus.modules.areaStaff.entity.AreaStaffUserInfo;
 import com.jeeplus.modules.signatureManagement.electronicSignature.entity.DistrictDirectorApplication;
 import com.jeeplus.modules.sys.entity.Area;
 import com.jeeplus.modules.sys.entity.Office;
@@ -74,6 +75,17 @@ public class AreaStaffService  extends TreeService<AreaStaffDao, AreaStaffInfo>
             projectAccessoryInfoList.addAll(0,this.fingIds(parentIdSet,"0"));
             projectAccessoryInfoList.addAll(0,this.fingIds(parentIdSet,UserUtils.getSelectCompany().getId()));
         }
+        //查询所有人员信息
+        List<String> idList = Lists.newArrayList();
+        for (AreaStaffInfo areaStaffInfo : list) {
+            idList.add(areaStaffInfo.getId());
+        }
+        //根据id查询人员信息
+        List<AreaStaffInfo> userListByIdList = dao.getUserListByIdList(idList);
+
+        if (userListByIdList!=null && userListByIdList.size()!=0){
+            projectAccessoryInfoList.addAll(userListByIdList);
+        }
         sortList(listReturn,projectAccessoryInfoList,"0",true);
         return listReturn;
     }
@@ -139,7 +151,31 @@ public class AreaStaffService  extends TreeService<AreaStaffDao, AreaStaffInfo>
                 areaStaffInfo.setStandardDetail(areaStaffInfo.getOffice().getId());
             }
         }
+
+        //判定是否填写管理地区和地区责任人
+        AreaStaffInfo secondAreaStaffInfo = new AreaStaffInfo();
+        Boolean secondFlag = false;
+        if(StringUtils.isNotBlank(areaStaffInfo.getAreaManagement()) && StringUtils.isNotBlank(areaStaffInfo.getAreaLeaderId())){
+            secondAreaStaffInfo.setAreaManagement(areaStaffInfo.getAreaManagement());
+            secondAreaStaffInfo.setAreaLeaderId(areaStaffInfo.getAreaLeaderId());
+            areaStaffInfo.setAreaManagement("");
+            areaStaffInfo.setAreaLeaderId("");
+            secondFlag = true;
+        }
+
+        //根据所选部门查询是否已经存在
+        AreaStaffInfo officeAreaStaffInfo = dao.getOfficeInfo(areaStaffInfo.getOffice().getId());
+        if(null != officeAreaStaffInfo){
+            areaStaffInfo.setId(officeAreaStaffInfo.getId());
+        }
         super.save(areaStaffInfo);
+
+        if(secondFlag){
+            secondAreaStaffInfo.setParent(areaStaffInfo);
+            secondAreaStaffInfo.setOffice(areaStaffInfo.getOffice());
+            secondAreaStaffInfo.setHierarchy("2");
+            this.secondSave(secondAreaStaffInfo);
+        }
     }
 
     /**
@@ -175,7 +211,7 @@ public class AreaStaffService  extends TreeService<AreaStaffDao, AreaStaffInfo>
         //对数据进行保存
         super.save(areaStaffInfo);
         //添加地区负责人和区域员工分支
-        AreaStaffInfo areaMasterInfo = new AreaStaffInfo();
+        /*AreaStaffInfo areaMasterInfo = new AreaStaffInfo();
         areaMasterInfo.setParent(areaStaffInfo);
         if(StringUtils.isNotBlank(areaStaffInfo.getHierarchy())){
             areaMasterInfo.setHierarchy(String.valueOf(Integer.parseInt(areaStaffInfo.getHierarchy()) + 1));
@@ -192,10 +228,10 @@ public class AreaStaffService  extends TreeService<AreaStaffDao, AreaStaffInfo>
         if(masterInfoList.size()==0){
             //对数据进行保存
             super.save(areaMasterInfo);
-        }
+        }*/
 
         //添加地区负责人和区域员工分支
-        AreaStaffInfo areaGeneralInfo = new AreaStaffInfo();
+        /*AreaStaffInfo areaGeneralInfo = new AreaStaffInfo();
         areaGeneralInfo.setParent(areaStaffInfo);
         if(StringUtils.isNotBlank(areaStaffInfo.getHierarchy())){
             areaGeneralInfo.setHierarchy(String.valueOf(Integer.parseInt(areaStaffInfo.getHierarchy()) + 1));
@@ -212,7 +248,7 @@ public class AreaStaffService  extends TreeService<AreaStaffDao, AreaStaffInfo>
         if(generalInfoList.size()==0){
             //对数据进行保存
             super.save(areaGeneralInfo);
-        }
+        }*/
     }
 
     @Transactional(readOnly = false)
@@ -350,8 +386,23 @@ public class AreaStaffService  extends TreeService<AreaStaffDao, AreaStaffInfo>
     @Transactional(readOnly = false)
     public User saveUser(AreaStaffInfo areaStaffInfo,User user){
         areaStaffInfo = this.get(areaStaffInfo.getId());
+
+        AreaStaffUserInfo areaStaffUserInfo = new AreaStaffUserInfo();
+        areaStaffUserInfo.setAreaStaffId(areaStaffInfo.getId());
+        areaStaffUserInfo.setUserId(user.getId());
+        //判定该节点下是否存在该成员信息
+        Integer existsUserCount = dao.getExistsUser(areaStaffUserInfo);
+        if (existsUserCount>0){
+            //该节点下存在人员信息,无需进行添加
+
+        }else{
+            areaStaffUserInfo.preInsert();
+            dao.insertAreaStaffUser(areaStaffUserInfo);
+        }
+
+
         //查询节点下是否存在该人员信息
-        areaStaffInfo.setStandardDetail(user.getId());
+        /*areaStaffInfo.setStandardDetail(user.getId());
         List<User> userByParentId = dao.getUserByParentIdAndStandardDetail(areaStaffInfo);
         if(userByParentId.size()==0){
             //添加地区负责人和区域员工分支
@@ -368,7 +419,7 @@ public class AreaStaffService  extends TreeService<AreaStaffDao, AreaStaffInfo>
 
             //对数据进行保存
             super.save(areaMasterInfo);
-        }
+        }*/
 
         return user;
     }
@@ -394,7 +445,6 @@ public class AreaStaffService  extends TreeService<AreaStaffDao, AreaStaffInfo>
         Map<String,Object> map = new HashMap<>();
         //判定是否存在部门信息,若存在则先验证该部门是否存在在表中
         if(null ==directorApplication.getOffice() || StringUtils.isBlank(directorApplication.getOffice().getId())
-                || null ==directorApplication.getArea() || StringUtils.isBlank(directorApplication.getArea().getId())
                 || null ==directorApplication.getCreateBy() || StringUtils.isBlank(directorApplication.getCreateBy().getId())){
             map.put("success",false);
             map.put("message","申请人、申请部门或申请地区错误,无法添加地区管理员");
@@ -412,44 +462,14 @@ public class AreaStaffService  extends TreeService<AreaStaffDao, AreaStaffInfo>
             AreaStaffInfo officeInfo = dao.getOfficeInfo(directorApplication.getOffice().getId());
             if(null != officeInfo){
                 //如果部门不为空,则验证该部门下 的地区是否存在
-                List<AreaStaffInfo> areaInfo = dao.getAreaStaffInfoByParentIdAndStandardDetail(directorApplication.getArea().getId(), officeInfo.getId());
+                List<AreaStaffInfo> areaInfo = dao.getAreaStaffInfoByParentIdAndAreaManagement(directorApplication.getAreaDirector(), officeInfo.getId());
                 if(null != areaInfo && areaInfo.size()>0){
-                    //如果地区不为空,则查询地区下是否存在地区负责人项,若存在,则直接添加人员信息
-                    List<AreaStaffInfo> masterType = dao.getAreaStaffInfoByParentIdAndType("master", areaInfo.get(0).getId());
-                    if(null != masterType && masterType.size()>0){
-                        //查询该地区下是否已经存在该人员信息
-                        //如果地区负责人标签存在则直接添加人员信息
-                        List<AreaStaffInfo> userList = dao.getAreaStaffInfoByParentIdAndStandardDetail(user.getId(), masterType.get(0).getId());
-                        if(userList.size() == 0){
-                            this.saveUser(masterType.get(0),user);
-                        }else{
-                            map.put("success",false);
-                            map.put("message","申请人已经是该地区负责人,无法重复添加");
-                            return map;
-                        }
-                    }else{
-                        //如果地区负责人标签不存在,则需添加标签后再添加人员信息
-                        //添加地区负责人和区域员工分支
-                        AreaStaffInfo areaMasterInfo = this.saveMasterType(areaInfo.get(0));
-                        this.saveUser(areaMasterInfo,user);
-                    }
-
-                    List<AreaStaffInfo> staffType = dao.getAreaStaffInfoByParentIdAndType("staff", areaInfo.get(0).getId());
-
-                    if(null != staffType && staffType.size()>0){
-
-                    }else{
-                        //如果地区员工标签不存在,则需添加标签
-                        this.saveStaffType(areaInfo.get(0));
-                    }
+                    map.put("success",false);
+                    map.put("message","该地区已存在,无法重复添加");
+                    return map;
                 }else{
                     //如果地区为空则进行地区添加和地区负责人添加
-                    AreaStaffInfo areaStaffInfo = this.saveAreaType(officeInfo, directorApplication.getArea().getId());
-                    //添加地区负责人和区域员工分支
-                    AreaStaffInfo areaMasterInfo = this.saveMasterType(areaStaffInfo);
-                    //如果地区员工标签不存在,则需添加标签
-                    this.saveStaffType(areaStaffInfo);
-                    this.saveUser(areaMasterInfo,user);
+                    AreaStaffInfo areaStaffInfo = this.saveAreaType(officeInfo, directorApplication.getArea().getId(),directorApplication);
 
                 }
 
@@ -457,12 +477,7 @@ public class AreaStaffService  extends TreeService<AreaStaffDao, AreaStaffInfo>
                 //如果部门不存在,则进行新增部门信息,区域信息,地区负责人信息
                 AreaStaffInfo areaOfficeInfo = this.saveOfficeType(directorApplication.getOffice().getId());
                 //如果地区为空则进行地区添加和地区负责人添加
-                AreaStaffInfo areaStaffInfo = this.saveAreaType(areaOfficeInfo, directorApplication.getArea().getId());
-                //添加地区负责人和区域员工分支
-                AreaStaffInfo areaMasterInfo = this.saveMasterType(areaStaffInfo);
-                //如果地区员工标签不存在,则需添加标签
-                this.saveStaffType(areaStaffInfo);
-                this.saveUser(areaMasterInfo,user);
+                AreaStaffInfo areaStaffInfo = this.saveAreaType(areaOfficeInfo, directorApplication.getArea().getId(),directorApplication);
             }
         }
         map.put("success",true);
@@ -471,55 +486,12 @@ public class AreaStaffService  extends TreeService<AreaStaffDao, AreaStaffInfo>
     }
 
     /**
-     * 添加地区负责人层级参数
-     * @param areaInfo
-     * @return
-     */
-    public AreaStaffInfo saveMasterType(AreaStaffInfo areaInfo){
-        AreaStaffInfo areaMasterInfo = new AreaStaffInfo();
-        areaMasterInfo.setParent(areaInfo);
-        if(StringUtils.isNotBlank(areaInfo.getHierarchy())){
-            areaMasterInfo.setHierarchy(String.valueOf(Integer.parseInt(areaInfo.getHierarchy()) + 1));
-        }else{
-            areaMasterInfo.setHierarchy("3");
-        }
-        areaMasterInfo.setStandardDetail("地区负责人");
-        areaMasterInfo.setType("master");
-        areaMasterInfo.setOrderNum(areaMasterInfo.getParent().getOrderNum() + "01");
-        areaMasterInfo.setCompanyId(UserUtils.getSelectCompany().getId());
-        super.save(areaMasterInfo);
-        return areaMasterInfo;
-    }
-
-
-    /**
-     * 添加地区负责人层级参数
-     * @param areaInfo
-     * @return
-     */
-    public AreaStaffInfo saveStaffType(AreaStaffInfo areaInfo){
-        AreaStaffInfo areaMasterInfo = new AreaStaffInfo();
-        areaMasterInfo.setParent(areaInfo);
-        if(StringUtils.isNotBlank(areaInfo.getHierarchy())){
-            areaMasterInfo.setHierarchy(String.valueOf(Integer.parseInt(areaInfo.getHierarchy()) + 1));
-        }else{
-            areaMasterInfo.setHierarchy("3");
-        }
-        areaMasterInfo.setStandardDetail("地区员工");
-        areaMasterInfo.setType("staff");
-        areaMasterInfo.setOrderNum(areaMasterInfo.getParent().getOrderNum() + "01");
-        areaMasterInfo.setCompanyId(UserUtils.getSelectCompany().getId());
-        super.save(areaMasterInfo);
-        return areaMasterInfo;
-    }
-
-    /**
      * 添加地区信息参数
      * @param officeInfo
      * @param areaId
      * @return
      */
-    public AreaStaffInfo saveAreaType(AreaStaffInfo officeInfo, String areaId){
+    public AreaStaffInfo saveAreaType(AreaStaffInfo officeInfo, String areaId,DistrictDirectorApplication directorApplication){
         AreaStaffInfo areaMasterInfo = new AreaStaffInfo();
         areaMasterInfo.setParent(officeInfo);
         if(StringUtils.isNotBlank(officeInfo.getHierarchy())){
@@ -530,6 +502,8 @@ public class AreaStaffService  extends TreeService<AreaStaffDao, AreaStaffInfo>
         areaMasterInfo.setStandardDetail(areaId);
         areaMasterInfo.setOrderNum(areaMasterInfo.getParent().getOrderNum() + "01");
         areaMasterInfo.setCompanyId(UserUtils.getSelectCompany().getId());
+        areaMasterInfo.setAreaLeaderId(directorApplication.getCreateBy().getId());
+        areaMasterInfo.setAreaManagement(directorApplication.getAreaDirector());
         super.save(areaMasterInfo);
         return areaMasterInfo;
     }

+ 10 - 10
src/main/java/com/jeeplus/modules/areaStaff/web/AreaStaffController.java

@@ -217,8 +217,8 @@ public class AreaStaffController extends BaseController {
                 office = officeService.get(areaStaffInfo.getParent().getStandardDetail());
                 areaStaffInfo.setOffice(office);
 
-                Area area = areaService.get(areaStaffInfo.getStandardDetail());
-                areaStaffInfo.setArea(area);
+                List<User> userList = areaStaffService.getUserByParentId(areaStaffInfo);
+                model.addAttribute("userList", userList);
                 break;
             case "4":
                 break;
@@ -257,7 +257,7 @@ public class AreaStaffController extends BaseController {
         }else{//新增表单保存
             areaStaffService.save(areaStaffInfo);//保存
         }
-        addMessage(redirectAttributes, "保存报销类型成功");
+        addMessage(redirectAttributes, "保存信息成功");
         return "redirect:"+ Global.getAdminPath()+"/areaStaff/areaStaff/?repage";
     }
 
@@ -284,11 +284,11 @@ public class AreaStaffController extends BaseController {
 
         //查询选择的office是否存在,若存在则判定area是否存在,若存在则抛出,若不存在则进行新增
         //查询选择的office是否存在,若不存在,则进行新增office,在新增地区
-        AreaStaffInfo effectiveArea = areaStaffService.getEffectiveArea(areaStaffInfo.getOffice().getId(), areaStaffInfo.getArea().getId());
+        /*AreaStaffInfo effectiveArea = areaStaffService.getEffectiveArea(areaStaffInfo.getOffice().getId(), areaStaffInfo.getArea().getId());
         if(null != effectiveArea){
             addMessage(redirectAttributes, "该地区已经被选择,请勿重新选择");
             return "redirect:"+ Global.getAdminPath()+"/areaStaff/areaStaff/?repage";
-        }
+        }*/
 
         if(!areaStaffInfo.getIsNewRecord()){//编辑表单保存
             AreaStaffInfo t = areaStaffService.get(areaStaffInfo.getId());//从数据库取出记录的值
@@ -297,7 +297,7 @@ public class AreaStaffController extends BaseController {
         }else{//新增表单保存
             areaStaffService.secondSave(areaStaffInfo);//保存
         }
-        addMessage(redirectAttributes, "保存报销类型成功");
+        addMessage(redirectAttributes, "保存信息成功");
         return "redirect:"+ Global.getAdminPath()+"/areaStaff/areaStaff/?repage";
     }
 
@@ -408,14 +408,14 @@ public class AreaStaffController extends BaseController {
     }
 
     /**
-     * 岗位分配
+     * 地区员工添加
      * @param areaStaffInfo
      * @param idsArr
      * @param redirectAttributes
      * @return
      */
     @RequestMapping(value = "assignUser")
-    public String assignRole(AreaStaffInfo areaStaffInfo, String[] idsArr, RedirectAttributes redirectAttributes) {
+    public String assignUser(AreaStaffInfo areaStaffInfo, String[] idsArr, RedirectAttributes redirectAttributes) {
         StringBuilder msg = new StringBuilder();
         int newNum = 0;
         for (int i = 0; i < idsArr.length; i++) {
@@ -442,10 +442,10 @@ public class AreaStaffController extends BaseController {
      * @return
      */
     @RequestMapping(value = "outUser")
-    public String outUser(String userId,String id,String view,RedirectAttributes redirectAttributes) {
+    public String outUser(String userId,String id,String areaStaffUserInfoId,RedirectAttributes redirectAttributes) {
         User user = systemService.getUser(userId);
 
-        Boolean flag = areaStaffService.outUserById(userId, id);
+        Boolean flag = areaStaffService.outUserById(userId, areaStaffUserInfoId);
         if (!flag) {
             addMessage(redirectAttributes, "用户【" + user.getName() + "】移除失败!");
         }else {

+ 10 - 10
src/main/java/com/jeeplus/modules/signatureManagement/electronicSignature/service/DistrictDirectorApplicationService.java

@@ -134,8 +134,8 @@ public class DistrictDirectorApplicationService extends CrudService<DistrictDire
         directorApplication.setArea(area);
         super.save(directorApplication);
         String str = "";
-        String title = "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责地区:"+area.getName()+"待审批";
-        str = "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责地区:"+area.getName()+"待审批";
+        String title = "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责区域:"+directorApplication.getTerritory()+"待审批";
+        str = "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责区域:"+directorApplication.getTerritory()+"待审批";
 
         // 启动流程
         String businessKey = directorApplication.getId().toString();
@@ -222,7 +222,7 @@ public class DistrictDirectorApplicationService extends CrudService<DistrictDire
         }
         variables.put("type", processType);
         variables.put("busId", businessKey);
-        variables.put("title", "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责地区:"+area.getName()+"待审批");//设置标题;
+        variables.put("title", "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责区域:"+directorApplication.getTerritory()+"待审批");//设置标题;
         long s8=System.currentTimeMillis();
         ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processType, businessKey, variables);
         directorApplication.setProcessInstance(processInstance);
@@ -366,10 +366,10 @@ public class DistrictDirectorApplicationService extends CrudService<DistrictDire
                         if(! success){
                             return message;
                         }
-                        notifyRole = "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责地区:"+directorApplication.getArea().getName()+"审核完成";
+                        notifyRole = "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责区域:"+directorApplication.getTerritory()+"审核完成";
                         workActivityProcess.setIsApproval("1");
                     } else {
-                        notifyRole = "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责地区:"+directorApplication.getArea().getName()+"调整申请";
+                        notifyRole = "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责区域:"+directorApplication.getTerritory()+"调整申请";
                         workActivityProcess.setIsApproval("2");
                     }
                     break;
@@ -445,7 +445,7 @@ public class DistrictDirectorApplicationService extends CrudService<DistrictDire
             }
             try {
                 //结束该流程,设为"撤销"状态
-                actTaskService.endProcessInstance(directorApplication.getProcessInstanceId(),"地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责地区:"+directorApplication.getArea().getName()+"驳回操作");
+                actTaskService.endProcessInstance(directorApplication.getProcessInstanceId(),"地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责区域:"+directorApplication.getTerritory()+"驳回操作");
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -454,8 +454,8 @@ public class DistrictDirectorApplicationService extends CrudService<DistrictDire
         List<User> users = new ArrayList<>();
         List<User> userList = new ArrayList<>();
         if (!state) {
-            str =  "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责地区:"+directorApplication.getArea().getName()+"申请成功" ;
-            title = "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责地区:"+directorApplication.getArea().getName()+"申请成功";
+            str =  "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责区域:"+directorApplication.getTerritory()+"申请成功" ;
+            title = "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责区域:"+directorApplication.getTerritory()+"申请成功";
             users.add(directorApplication.getCreateBy());
             if ("yes".equals(directorApplication.getAct().getFlag())) {
                 directorApplication.setStatus("5");
@@ -501,8 +501,8 @@ public class DistrictDirectorApplicationService extends CrudService<DistrictDire
                 str =  "地区负责人申请被驳回,驳回意见:" + directorApplication.getAct().getComment();
                 title = "地区申请人申请被驳回,驳回意见:" + directorApplication.getAct().getComment();
             }else{
-                str =  "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责地区:"+directorApplication.getArea().getName()+"被驳回";
-                title = "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责地区:"+directorApplication.getArea().getName()+"被驳回";
+                str =  "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责区域:"+directorApplication.getTerritory()+"被驳回";
+                title = "地区负责人申请-"+directorApplication.getCreateBy().getName()+"-负责区域:"+directorApplication.getTerritory()+"被驳回";
             }
             users.add(directorApplication.getCreateBy());
 

+ 1 - 1
src/main/resources/jeeplus.properties

@@ -7,7 +7,7 @@ jdbc.type=mysql
 jdbc.driver=com.mysql.jdbc.Driver
 db.name=ruihuaoa-activity-data
 #jdbc.url=jdbc:mysql://8.136.152.135:3306/new_ccpm?useUnicode=true&characterEncoding=utf-8
-jdbc.url=jdbc:mysql://192.168.2.4:3306/new_ccpm?useUnicode=true&characterEncoding=utf-8
+jdbc.url=jdbc:mysql://127.0.0.1:3306/new_ccpm?useUnicode=true&characterEncoding=utf-8
 jdbc.username=root
 jdbc.password=root
 #jdbc.password=Xgcomdata10376@

+ 88 - 17
src/main/resources/mappings/modules/areaStaff/AreaStaffDao.xml

@@ -16,14 +16,18 @@
 		a.company_id AS "companyId",
 		a.order_num AS "orderNum",
 		a.hierarchy AS "hierarchy",
-		a.type AS "type"
+		a.type AS "type",
+		a.area_management AS "areaManagement",
+		a.area_leader_id AS "areaLeaderId"
 	</sql>
 
 
 	<select id="get" resultType="com.jeeplus.modules.areaStaff.entity.AreaStaffInfo" >
 		SELECT
 		<include refid="workReviewStandardColumns"/>
+		,su.name as "leaderName"
 		FROM sys_area_staff a
+		left join sys_user su on su.id = a.area_leader_id
 		WHERE a.id = #{id}
 	</select>
 
@@ -34,8 +38,10 @@
 		when a.hierarchy = '2' then (select sa.name from sys_area sa where sa.id = a.standard_detail)
 		when a.hierarchy = '3' then a.standard_detail
 		when a.hierarchy = '4' then (select su.name from sys_user su where su.id = a.standard_detail)
-		else '' end) as standardDetailStr
+		else '' end) as standardDetailStr,
+		su.name as "leaderName"
 		FROM sys_area_staff a
+		left join sys_user su on su.id = a.area_leader_id
 		<where>
 			a.del_flag = 0
 			<if test="standardDetail!=null and standardDetail != ''">
@@ -101,7 +107,9 @@
 			company_id,
 			order_num,
 			hierarchy,
-			type
+			type,
+			area_management,
+			area_leader_id
 		) VALUES (
 			#{id},
 			#{createBy.id},
@@ -116,7 +124,9 @@
 			#{companyId},
 			#{orderNum},
 			#{hierarchy},
-			#{type}
+			#{type},
+			#{areaManagement},
+			#{areaLeaderId}
 		)
 	</insert>
 
@@ -245,16 +255,16 @@
 		o.name AS "office.name",
 		o.top_company AS "office.topCompany",
 		o.parent_id AS "office.parent.id",
-		o.parent_ids AS "office.parentIds"
+		o.parent_ids AS "office.parentIds",
+		sasui.id as "auditUserId"
 		from sys_user a
 		left join sys_office o on a.office_id = o.id
 		left join sys_office s on a.company_id = s.id
-		where a.id in (
-		select standard_detail from sys_area_staff
+		left join sys_area_staff_user_info sasui on sasui.user_id = a .id
 		<where>
-			parent_id = #{id} and del_flag = 0
+			sasui.area_staff_id = #{id} and sasui.del_flag = 0
 		</where>
-		)
+
 	</select>
 
 	<select id="getUserByParentIdAndStandardDetail" resultType="User">
@@ -279,28 +289,28 @@
 		</where>
 	</select>
 
-	<select id="getAreaStaffInfoByParentIdAndType" resultType="com.jeeplus.modules.areaStaff.entity.AreaStaffInfo">
+	<select id="getAreaStaffInfoByParentIdAndAreaManagement" resultType="com.jeeplus.modules.areaStaff.entity.AreaStaffInfo">
 		select * from sys_area_staff
 		<where>
 			parent_id = #{parentId} and del_flag = 0
-			<if test="type != null and type != ''">
-				and type = #{type}
+			<if test="areaManagement != null and areaManagement != ''">
+				and area_management = #{areaManagement}
 			</if>
 		</where>
 	</select>
 
 	<update id="outUserById">
-		update sys_area_staff set
+		update sys_area_staff_user_info set
 		del_flag = 1
-		where parent_id = #{parentId}
-		and standard_detail = #{userId}
+		where id = #{id}
+		and user_id = #{userId}
 	</update>
 
 	<update id="deleteChildrenByParentId">
-		update sys_area_staff set
+		update sys_area_staff_user_info set
 		del_flag = 1
 		<where>
-			parent_ids like concat('%',#{id},'%')
+			id = #{id}
 		</where>
 	</update>
 
@@ -313,5 +323,66 @@
 		</where>
 		limit 1
 	</select>
+
+	<select id="getExistsUser" resultType="java.lang.Integer">
+		select count(1) from sys_area_staff_user_info
+		<where>
+			area_staff_id = #{areaStaffId}
+			and user_id = #{userId}
+		</where>
+	</select>
+
+	<insert id="insertAreaStaffUser">
+		insert into sys_area_staff_user_info (
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			area_staff_id,
+			user_id
+		)
+		values
+  		(
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{areaStaffId},
+			#{userId}
+  		)
+	</insert>
+
+	<select id="getUserListByIdList" resultType="com.jeeplus.modules.areaStaff.entity.AreaStaffInfo">
+		select
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.area_staff_id as "parent.id",
+		a.user_id as "standardDetail",
+		concat(sas.parent_ids,',',a.area_staff_id) as "parentIds",
+		su.name as "leaderName"
+		from sys_area_staff_user_info a
+		left join sys_user su on su.id = a.user_id
+		left join sys_area_staff sas on sas.id = a.area_staff_id
+		<where>
+			<if test="idList.size>0">
+				and a.area_staff_id in
+				<foreach collection="idList" item="id" separator="," open="(" close=")">
+					#{id}
+				</foreach>
+			</if>
+			and a.del_flag = 0
+		</where>
+	</select>
 	
 </mapper>

+ 178 - 121
src/main/resources/mappings/modules/workinvoice/WorkInvoiceDao.xml

@@ -1070,127 +1070,184 @@
 	FROM (
 		SELECT
 			distinct (a.id) AS "id",a.money
-		FROM work_invoice a
-		<include refid="workInvoiceJoins"/>
-		left join work_invoice_detail wid on a.id = wid.invoice_id
-		<where>
-			a.del_flag = #{DEL_FLAG_NORMAL}
-			and a.invoice_state = 5
-			<if test="number != null and number != ''">
-				AND a.number LIKE
-				<if test="dbName == 'oracle'">'%'||#{number}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{number}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{number},'%')</if>
-			</if>
-			<if test="receiptBeginDate != null and receiptBeginDate != ''">
-				AND date_format(a.receipt_money_date,'%Y-%m-%d') &gt;= date_format(#{receiptBeginDate},'%Y-%m-%d')
-			</if>
-			<if test="receiptEndDate != null and receiptEndDate != ''">
-				AND date_format(a.receipt_money_date,'%Y-%m-%d') &lt;= date_format(#{receiptEndDate},'%Y-%m-%d')
-			</if>
-			<if test="beginContractDate != null and endContractDate != null and beginContractDate != '' and endContractDate != ''">
-				AND a.invoice_date BETWEEN #{beginContractDate} AND #{endContractDate}
-			</if>
-			<if test="client != null and client.id != null and client.id != ''">
-				AND a.client_id = #{client.id}
-			</if>
-			<if test="project != null and project.id != null and project.id != ''">
-				AND a.project_id = #{project.id}
-			</if>
-			<if test="project != null and project.projectId != null and project.projectId != ''">
-				AND p.project_id LIKE
-				<if test="dbName == 'oracle'">'%'||#{project.projectId}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{project.projectId}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{project.projectId},'%')</if>
-			</if>
-			<if test="project != null and project.projectName != null and project.projectName != ''">
-				AND p.project_name LIKE
-				<if test="dbName == 'oracle'">'%'||#{project.projectName}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{project.projectName}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{project.projectName},'%')</if>
-			</if>
-			<if test="project != null and project.reportData != null and project.reportData.number != null and project.reportData.number != ''">
-				AND prd.number LIKE
-				<if test="dbName == 'oracle'">'%'||#{project.reportData.number}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{project.reportData.number}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{project.reportData.number},'%')</if>
-			</if>
-			<if test="client != null and client.name != null and client.name != ''">
-				AND w.name LIKE
-				<if test="dbName == 'oracle'">'%'||#{client.name}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{client.name}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{client.name},'%')</if>
-			</if>
-			<if test="officeId != null and officeId != ''">
-				AND so.id  = #{officeId}
-			</if>
-			<if test="money != null and money != ''">
-				AND a.money = #{money}
-			</if>
-			<if test="(submitterId != null and submitterId != '') or (submitterName != null and submitterName != '')">
-				AND (a.create_by = #{submitterId} or su.name like concat('%',#{submitterName},'%'))
-			</if>
-			<if test="receiptMoney != null and receiptMoney != ''">
-				AND a.receipt_money = #{receiptMoney}
-			</if>
-			<if test="invoiceType != null and invoiceType != ''">
-				AND a.invoice_type = #{invoiceType}
-			</if>
-			<if test="chargeType != null and chargeType != ''">
-				AND a.charge_type = #{chargeType}
-			</if>
-			<if test="content != null and content != ''">
-				AND a.content = #{content}
-			</if>
-			<if test="drawer != null and drawer.id != null and drawer.id != ''">
-				AND a.drawer_id = #{drawer.id}
-			</if>
-			<if test="companyId != null and companyId != ''">
-				AND a.company_id = #{companyId}
-			</if>
-			<if test="office != null and office.id != null and office.id != ''">
-				AND a.office_id = #{office.id}
-			</if>
-			<if test="invoiceNumber != null and invoiceNumber != ''">
-				AND a.invoice_number LIKE
-					<if test="dbName == 'oracle'">'%'||#{invoiceNumber}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{invoiceNumber}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{invoiceNumber},'%')</if>
-			</if>
-			<if test="invoiceDate != null and invoiceDate != ''">
-				AND a.invoice_date = #{invoiceDate}
-			</if>
-			<if test="isInvoice != null and isInvoice != ''">
-				AND a.is_invoice = #{isInvoice}
-			</if>
-			<if test="isCharge != null and isCharge != ''">
-				AND a.is_charge = #{isCharge}
-			</if>
-			<if test="isInvalid != null and isInvalid != ''">
-				AND a.is_invalid = #{isInvalid}
-			</if>
-			<if test="billingContent != null and billingContent != ''">
-				AND a.billing_content = #{billingContent}
-			</if>
-			<if test="area != null and area.id != null and area.id != ''">
-				AND (a.area_parent_id LIKE
-				<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
-				or a.area_id = #{area.id}
-				)
-			</if>
-			<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
-				AND (a.account_checking_user_id = #{accountCheckingUserId} or acu.name like concat('%',#{accountCheckingUserName},'%'))
-			</if>
-			<if test="widNumber != null and widNumber != ''">
-				AND wid.number LIKE
-				<if test="dbName == 'oracle'">'%'||#{widNumber}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{widNumber}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{widNumber},'%')</if>
-			</if>
-			${sqlMap.dsf}
-		</where>
+			FROM work_invoice a
+	LEFT JOIN sys_user su ON su.id = a.create_by
+	LEFT JOIN work_client_info w ON  w.id = a.client_id
+	LEFT JOIN rural_project_records p ON  p.id = a.project_id
+	LEFT JOIN project_report_data prd ON  p.id = prd.project_id
+	left JOIN work_contract_info ci on ci.id = p.contract_id
+	JOIN sys_office o ON o.id = a.office_id
+	JOIN sys_office s ON s.id = a.company_id
+	LEFT join sys_office so on so.id = a.office_id
+	left join work_invoice_project_relation wipr on a.id = wipr.invoice_id
+	left join rural_project_records rprs on wipr.project_id = rprs.id
+	left join rural_project_records rpr on rpr.id = wipr.project_id
+	left join project_report_data prds on rpr.id = prds.project_id
+	left join work_invoice_detail wid on a.id = wid.invoice_id
+	LEFT JOIN sys_user sua ON sua.id = a.account_checking_user_id
+	left join sys_area sa on sa.id = a.area_id
+	<where>
+		a.del_flag = #{DEL_FLAG_NORMAL}
+		<if test="number != null and number != ''">
+			AND a.number LIKE
+			<if test="dbName == 'oracle'">'%'||#{number}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{number}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{number},'%')</if>
+		</if>
+		<if test="invoiceState != null and invoiceState != ''">
+			AND a.invoice_state = #{invoiceState} or a.cancellation_state = #{invoiceState}
+		</if>
+		<if test="beginContractDate != null and endContractDate != null and beginContractDate != '' and endContractDate != ''">
+			AND a.invoice_date BETWEEN #{beginContractDate} AND #{endContractDate}
+		</if>
+
+		<if test="receiptBeginDate != null and receiptBeginDate != ''">
+			AND date_format(a.receipt_money_date,'%Y-%m-%d') &gt;= date_format(#{receiptBeginDate},'%Y-%m-%d')
+		</if>
+		<if test="receiptEndDate != null and receiptEndDate != ''">
+			AND date_format(a.receipt_money_date,'%Y-%m-%d') &lt;= date_format(#{receiptEndDate},'%Y-%m-%d')
+		</if>
+
+		<if test="client != null and client.id != null and client.id != ''">
+			AND a.client_id = #{client.id}
+		</if>
+		<if test="project != null and project.id != null and project.id != ''">
+			AND a.project_id = #{project.id}
+		</if>
+		<if test="project != null and project.projectId != null and project.projectId != ''">
+			AND p.project_id LIKE
+			<if test="dbName == 'oracle'">'%'||#{project.projectId}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{project.projectId}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{project.projectId},'%')</if>
+		</if>
+		<if test="project != null and project.projectName != null and project.projectName != ''">
+			AND p.project_name LIKE
+			<if test="dbName == 'oracle'">'%'||#{project.projectName}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{project.projectName}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{project.projectName},'%')</if>
+		</if>
+		<if test="project != null and project.reportData != null and project.reportData.number != null and project.reportData.number != ''">
+			AND prd.number LIKE
+			<if test="dbName == 'oracle'">'%'||#{project.reportData.number}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{project.reportData.number}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{project.reportData.number},'%')</if>
+		</if>
+		<if test="client != null and client.name != null and client.name != ''">
+			AND w.name LIKE
+			<if test="dbName == 'oracle'">'%'||#{client.name}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{client.name}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{client.name},'%')</if>
+		</if>
+		<!--<if test="officeId != null and officeId != ''">
+            AND so.id  = #{officeId}
+        </if>-->
+		<if test="money != null and money != ''">
+			AND a.money = #{money}
+		</if>
+		<!--<if test="submitterId != null and submitterId != ''">
+            AND a.create_by = #{submitterId}
+        </if>-->
+		<if test="(submitterId != null and submitterId != '') or (submitterName != null and submitterName != '')">
+			AND (a.create_by = #{submitterId} or su.name like concat('%',#{submitterName},'%'))
+		</if>
+		<if test="receiptMoney != null and receiptMoney != ''">
+			AND a.receipt_money = #{receiptMoney}
+		</if>
+		<if test="invoiceType != null and invoiceType != ''">
+			AND a.invoice_type = #{invoiceType}
+		</if>
+		<if test="chargeType != null and chargeType != ''">
+			AND a.charge_type = #{chargeType}
+		</if>
+		<if test="content != null and content != ''">
+			AND a.content = #{content}
+		</if>
+		<if test="drawer != null and drawer.id != null and drawer.id != ''">
+			AND a.drawer_id = #{drawer.id}
+		</if>
+		<if test="companyId != null and companyId != ''">
+			AND a.company_id = #{companyId}
+		</if>
+		<!--<if test="office != null and office.id != null and office.id != ''">
+            AND a.office_id = #{office.id}
+        </if>-->
+		<if test="officeIdList!=null and officeIdList.size!=0">
+			and a.office_id in
+			<foreach collection="officeIdList" item="officeId" separator="," open="(" close=")">
+				#{officeId}
+			</foreach>
+		</if>
+		<if test="invoiceNumber != null and invoiceNumber != ''">
+			AND a.invoice_number LIKE
+			<if test="dbName == 'oracle'">'%'||#{invoiceNumber}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{invoiceNumber}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{invoiceNumber},'%')</if>
+		</if>
+		<if test="invoiceDate != null and invoiceDate != ''">
+			AND a.invoice_date = #{invoiceDate}
+		</if>
+		<if test="isInvoice != null and isInvoice != ''">
+			AND a.is_invoice = #{isInvoice}
+		</if>
+		<if test="isCharge != null and isCharge != ''">
+			AND a.is_charge = #{isCharge}
+		</if>
+		<if test="isInvalid != null and isInvalid != ''">
+			AND a.is_invalid = #{isInvalid}
+		</if>
+		<if test="billingContent != null and billingContent != ''">
+			AND a.billing_content = #{billingContent}
+		</if>
+		<if test="area != null and area.id != null and area.id != ''">
+			AND (a.area_parent_id LIKE
+			<if test="dbName == 'oracle'">'%'||#{area.id}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{area.id}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{area.id},'%')</if>
+			or a.area_id = #{area.id}
+			)
+		</if>
+		<if test="(accountCheckingUserId != null and accountCheckingUserId != '') or (accountCheckingUserName != null and accountCheckingUserName != '')">
+			AND (a.account_checking_user_id = #{accountCheckingUserId} or sua.name like concat('%',#{accountCheckingUserName},'%'))
+		</if>
+		<if test="widNumber != null and widNumber != ''">
+			AND wid.number LIKE
+			<if test="dbName == 'oracle'">'%'||#{widNumber}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{widNumber}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{widNumber},'%')</if>
+		</if>
+		<if test="newDrawerId != null and newDrawerId != ''">
+			and new_drawer_id like
+			<if test="dbName == 'oracle'">'%'||#{newDrawerId}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{newDrawerId}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{newDrawerId},'%')</if>
+		</if>
+		<if test="newDrawer != null and newDrawer != ''">
+			and new_drawer like
+			<if test="dbName == 'oracle'">'%'||#{newDrawer}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{newDrawer}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{newDrawer},'%')</if>
+		</if>
+		<if test="projectName != null and projectName != ''">
+			and (wipr.details like
+			<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
+			or rpr.project_name like
+			<if test="dbName == 'oracle'">'%'||#{projectName}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{projectName}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{projectName},'%')</if>
+			)
+		</if>
+		<if test="reportNumber != null and reportNumber != ''">
+			and prds.number like
+			<if test="dbName == 'oracle'">'%'||#{reportNumber}||'%'</if>
+			<if test="dbName == 'mssql'">'%'+#{reportNumber}+'%'</if>
+			<if test="dbName == 'mysql'">concat('%',#{reportNumber},'%')</if>
+		</if>
+
+
+		${sqlMap.dsf}
+	</where>
 	) as x
 	</select>
 

+ 19 - 2
src/main/webapp/webpage/modules/areaStaff/areaStaffForm.jsp

@@ -73,14 +73,31 @@
 			<form:hidden path="hierarchy"/>
 			<div class="form-group layui-row first">
 				<div class="form-group-label"><h2>关联部门信息</h2></div>
-
-				<div class="layui-item layui-col-sm6">
+				<div class="layui-item layui-col-sm6 lw7">
 					<label class="layui-form-label"><span class="require-item">*</span>归属部门:</label>
 					<div class="layui-input-block  with-icon">
 						<sys:treeselectbelongingDepartment id="reviewParent" name="office.id" value="${areaStaffInfo.office.id}" labelName="office.name" labelValue="${areaStaffInfo.office.name}"
 														   cssStyle="background-color:#fff" title="归属部门" url="/sys/office/treeData?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
 					</div>
 				</div>
+
+				<div class="layui-item layui-col-sm6 lw7">
+				</div>
+
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label"><span class="require-item">*</span>管理地区:</label>
+					<div class="layui-input-block">
+						<form:input path="areaManagement" placeholder="请输入管理地区" htmlEscape="false"  class="form-control layui-input required"/>
+					</div>
+				</div>
+
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label"><span class="require-item">*</span>地区责任人:</label>
+					<div class="layui-input-block  with-icon">
+						<sys:inquireselectUser id="master" name="areaLeaderId" value="${areaStaffInfo.areaLeaderId}" labelName="leaderName" labelValue="${areaStaffInfo.leaderName}"
+											   cssStyle="background-color:#fff"  title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
+					</div>
+				</div>
 			</div>
 		</form:form>
 	</div>

+ 28 - 22
src/main/webapp/webpage/modules/areaStaff/areaStaffList.jsp

@@ -7,8 +7,8 @@
 	<%@include file="/webpage/include/treetable.jsp" %>
 	<script type="text/javascript">
 		$(document).ready(function() {
-			//此处用于展示层级限制(expandLevel参数),当前即打开展示到第
-			$("#treeTable").treeTable({expandLevel : 3},{ expandable: true });
+			//此处用于展示层级限制(expandLevel参数),当前即打开展示到第
+			$("#treeTable").treeTable({expandLevel : 2},{ expandable: true });
 		});
 	</script>
 	<style>
@@ -68,8 +68,8 @@
 				<table id="treeTable" class="table table-bordered table-hover list-table">
 					<thead>
 					<tr>
-						<th >部门/地区/角色/人员</th>
-						<%--<th >序号</th>--%>
+						<th >部门/地区描述</th>
+						<th >人员信息</th>
 						<th width="240px">操作</th>
 					</tr>
 					</thead>
@@ -77,11 +77,16 @@
 					<c:forEach items="${list}" var="areaStaffInfo">
 						<tr id="${areaStaffInfo.id}" pid="${areaStaffInfo.parent.id}">
 							<td>
-								<c:if test="${areaStaffInfo.grade == 0 || areaStaffInfo.grade ==1}">
+								<c:if test="${areaStaffInfo.grade == 0}">
 									<a  href="#" onclick="openDialogView('查看详情', '${ctx}/areaStaff/areaStaff/view?id=${areaStaffInfo.id}','80%', '60%')">
 										${areaStaffInfo.standardDetailStr}
 									</a>
 								</c:if>
+								<c:if test="${areaStaffInfo.grade ==1}">
+									<a  href="#" onclick="openDialogView('查看详情', '${ctx}/areaStaff/areaStaff/view?id=${areaStaffInfo.id}','80%', '60%')">
+										${areaStaffInfo.areaManagement}
+									</a>
+								</c:if>
 								<c:if test="${areaStaffInfo.grade == 2}">
 									<a  href="#" onclick="openDialogView('查看详情', '${ctx}/areaStaff/areaStaff/userForm?parent.id=${areaStaffInfo.id}','80%', '60%')">
 											${areaStaffInfo.standardDetailStr}
@@ -94,32 +99,33 @@
 									</a>
 								</c:if>
 							</td>
-							<%--<td style="text-align: center">
-									${areaStaffInfo.orderNum}
-							</td>--%>
+							<td style="text-align: center">
+									${areaStaffInfo.leaderName}
+							</td>
 							<td class="op-td text-center">
 								<div class="op-btn-box">
 									<div class="layui-btn-group">
 										<c:if test="${areaStaffInfo.grade == 0}">
-											<shiro:hasPermission name="reimbursementType:reimbursementType:add">
-												<a href="javascript:void(0);" onclick="openDialog('添加部门地区', '${ctx}/areaStaff/areaStaff/secondForm?parent.id=${areaStaffInfo.id}','80%','60%')" class="layui-btn layui-btn-xs layui-bg-blue"> 添加地区</a>
+											<shiro:hasPermission name="areaStaff:areaStaff:add">
+												<a href="javascript:void(0);" onclick="openDialog('添加信息', '${ctx}/areaStaff/areaStaff/secondForm?parent.id=${areaStaffInfo.id}','80%','60%')" class="layui-btn layui-btn-xs layui-bg-blue"> 添加管理信息</a>
 											</shiro:hasPermission>
 										</c:if>
 										<c:if test="${areaStaffInfo.grade ==1}">
-											<shiro:hasPermission name="reimbursementType:reimbursementType:del">
-												<a href="${ctx}/areaStaff/areaStaff/delete?id=${areaStaffInfo.id}" onclick="return confirmx('确认要删除该地区吗?同时将删除其下所有子节点和人员信息', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除地区</a>
+											<shiro:hasPermission name="areaStaff:areaStaff:del">
+												<a href="javascript:void(0);" onclick="openDialog('添加人员信息', '${ctx}/areaStaff/areaStaff/userForm?parent.id=${areaStaffInfo.id}','80%','60%')" class="layui-btn layui-btn-xs  #16b777"> 地区成员管理</a>
+												<a href="${ctx}/areaStaff/areaStaff/delete?id=${areaStaffInfo.id}" onclick="return confirmx('确认要删除该地区吗?同时将删除其下所有人员信息', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除</a>
 											</shiro:hasPermission>
 										</c:if>
-										<c:if test="${areaStaffInfo.grade ==2}">
-											<shiro:hasPermission name="reimbursementType:reimbursementType:add">
-												<a href="javascript:void(0);" onclick="openDialog('添加人员信息', '${ctx}/areaStaff/areaStaff/userForm?parent.id=${areaStaffInfo.id}','80%','60%')" class="layui-btn layui-btn-xs  #16b777"> 人员管理</a>
-											</shiro:hasPermission>
-										</c:if>
-										<%--<c:if test="${areaStaffInfo.grade ==3}">
-											<shiro:hasPermission name="reimbursementType:reimbursementType:del">
-												<a href="${ctx}/areaStaff/areaStaff/delete?id=${areaStaffInfo.id}" onclick="return confirmx('确认要删除该地区人员吗?', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除成员</a>
-											</shiro:hasPermission>
-										</c:if>--%>
+											<%--<c:if test="${areaStaffInfo.grade ==2}">
+                                                <shiro:hasPermission name="reimbursementType:reimbursementType:add">
+                                                    <a href="javascript:void(0);" onclick="openDialog('添加人员信息', '${ctx}/areaStaff/areaStaff/userForm?parent.id=${areaStaffInfo.id}','80%','60%')" class="layui-btn layui-btn-xs  #16b777"> 人员管理</a>
+                                                </shiro:hasPermission>
+                                            </c:if>
+                                            <c:if test="${areaStaffInfo.grade ==3}">
+                                                <shiro:hasPermission name="reimbursementType:reimbursementType:del">
+                                                    <a href="${ctx}/areaStaff/areaStaff/delete?id=${areaStaffInfo.id}" onclick="return confirmx('确认要删除该地区人员吗?', this.href)"   class="layui-btn layui-btn-xs layui-bg-red"> 删除成员</a>
+                                                </shiro:hasPermission>
+                                            </c:if>--%>
 									</div>
 								</div>
 							</td>

+ 21 - 3
src/main/webapp/webpage/modules/areaStaff/areaStaffSecondForm.jsp

@@ -84,7 +84,7 @@
 		<form:hidden path="hierarchy"/>
 			<div class="form-group layui-row first">
 				<div class="form-group-label"><h2>部门关联地区信息</h2></div>
-				<div class="layui-item layui-col-sm6">
+				<div class="layui-item layui-col-sm6 lw7">
 					<label class="layui-form-label"><span class="require-item">*</span>归属部门:</label>
 					<div class="layui-input-block  with-icon">
 						<sys:treeselectbelongingDepartment disabled="disabled" id="reviewParent" name="office.id" value="${areaStaffInfo.office.id}" labelName="office.name" labelValue="${areaStaffInfo.office.name}"
@@ -92,14 +92,32 @@
 					</div>
 				</div>
 
+				<div class="layui-item layui-col-sm6 lw7">
+				</div>
 
-				<div class="layui-item layui-col-sm6">
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label"><span class="require-item">*</span>管理地区:</label>
+					<div class="layui-input-block">
+						<form:input path="areaManagement" placeholder="请输入管理地区" htmlEscape="false"  class="form-control layui-input required"/>
+					</div>
+				</div>
+
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label"><span class="require-item">*</span>地区责任人:</label>
+					<div class="layui-input-block  with-icon">
+						<sys:inquireselectUser id="master" name="areaLeaderId" value="${areaStaffInfo.areaLeaderId}" labelName="leaderName" labelValue="${areaStaffInfo.leaderName}"
+											   cssStyle="background-color:#fff"  title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
+					</div>
+				</div>
+
+
+				<%--<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label"><span class="require-item">*</span>管理地区:</label>
 					<div class="layui-input-block  with-icon">
 						<sys:treeselectStaffArea id="area" name="area.id" value="${areaStaffInfo.area.id}" labelName="area.name" labelValue="${areaStaffInfo.area.name}"
 												   cssStyle="background-color: #fff" title="区域" url="/sys/area/treeData" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="false"/>
 					</div>
-				</div>
+				</div>--%>
 			</div>
 		</form:form>
 	</div>

+ 26 - 4
src/main/webapp/webpage/modules/areaStaff/areaStaffUserForm.jsp

@@ -85,22 +85,44 @@
 		<form:hidden path="hierarchy"/>
 			<div class="form-group layui-row first">
 				<div class="form-group-label"><h2>部门关联地区信息</h2></div>
-				<div class="layui-item layui-col-sm6">
+				<div class="layui-item layui-col-sm6 lw7">
 					<label class="layui-form-label"><span class="require-item">*</span>归属部门:</label>
 					<div class="layui-input-block  with-icon">
 						<sys:treeselectbelongingDepartment disabled="disabled" id="reviewParent" name="office.id" value="${areaStaffInfo.office.id}" labelName="office.name" labelValue="${areaStaffInfo.office.name}"
 														   cssStyle="background-color:#fff" title="归属部门" url="/sys/office/treeData?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
 					</div>
 				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label"><span class="require-item">*</span>管理地区:</label>
+					<div class="layui-input-block">
+						<form:input path="areaManagement" placeholder="请输入管理地区" htmlEscape="false" disabled="true" class="form-control layui-input required"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label"><span class="require-item">*</span>地区责任人:</label>
+					<div class="layui-input-block">
+						<form:input path="leaderName" placeholder="地区责任人" htmlEscape="false" disabled="true" class="form-control layui-input required"/>
+					</div>
+				</div>
 
+				<%--<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label"><span class="require-item">*</span>地区责任人:</label>
+					<div class="layui-input-block  with-icon">
+						<sys:inquireselectUser disabled="disable" id="master" name="areaLeaderId" value="${areaStaffInfo.areaLeaderId}" labelName="leaderName" labelValue="${areaStaffInfo.leaderName}"
+											   cssStyle="background-color:#fff"  title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
+					</div>
+				</div>--%>
 
-				<div class="layui-item layui-col-sm6">
+
+				<%--<div class="layui-item layui-col-sm6">
 					<label class="layui-form-label"><span class="require-item">*</span>管理地区:</label>
 					<div class="layui-input-block  with-icon">
 						<sys:treeselectStaffArea disabled="disabled" id="area" name="area.id" value="${areaStaffInfo.area.id}" labelName="area.name" labelValue="${areaStaffInfo.area.name}"
 												   cssStyle="background-color: #fff" title="区域" url="/sys/area/treeData" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="false"/>
 					</div>
-				</div>
+				</div>--%>
 			</div>
 		</form:form>
 		<div class="form-group layui-row">
@@ -134,7 +156,7 @@
 							<td>${user.phone}</td>
 							<td>${user.mobile}</td>
 							<shiro:hasPermission name="sys:role:edit"><td class="op-td">
-								<a href="${ctx}/areaStaff/areaStaff/outUser?userId=${user.id}&id=${areaStaffInfo.id}"
+								<a href="${ctx}/areaStaff/areaStaff/outUser?userId=${user.id}&id=${areaStaffInfo.id}&areaStaffUserInfoId=${user.auditUserId}"
 								   onclick="return confirmx('确认要将用户<b>[${user.name}]</b>移除吗?', this.href)" class="op-btn op-btn-add"><i class="glyphicon glyphicon-remove"></i> 移除</a>
 							</td></shiro:hasPermission>
 						</tr>

+ 86 - 3
src/main/webapp/webpage/modules/areaStaff/areaStaffView.jsp

@@ -42,7 +42,7 @@
 			<div class="form-group layui-row first">
 				<div class="form-group-label"><h2>详情</h2></div>
 				<c:if test="${areaStaffInfo.hierarchy == 1 or areaStaffInfo.hierarchy == 2}">
-					<div class="layui-item layui-col-sm6">
+					<div class="layui-item layui-col-sm6 lw7">
 						<label class="layui-form-label"><span class="require-item">*</span>归属部门:</label>
 						<div class="layui-input-block  with-icon">
 							<sys:treeselectbelongingDepartment disabled="disabled" id="reviewParent" name="office.id" value="${areaStaffInfo.office.id}" labelName="office.name" labelValue="${areaStaffInfo.office.name}"
@@ -50,8 +50,22 @@
 						</div>
 					</div>
 				</c:if>
+				<div class="layui-item layui-col-sm6 lw7">
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label"><span class="require-item">*</span>管理地区:</label>
+					<div class="layui-input-block">
+						<form:input path="areaManagement" placeholder="请输入管理地区" htmlEscape="false" disabled="true" class="form-control layui-input required"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6 lw7">
+					<label class="layui-form-label"><span class="require-item">*</span>地区责任人:</label>
+					<div class="layui-input-block">
+						<form:input path="leaderName" placeholder="地区责任人" htmlEscape="false" disabled="true" class="form-control layui-input required"/>
+					</div>
+				</div>
 
-				<c:if test="${areaStaffInfo.hierarchy == 2 }">
+				<%--<c:if test="${areaStaffInfo.hierarchy == 2 }">
 					<div class="layui-item layui-col-sm6">
 						<label class="layui-form-label"><span class="require-item">*</span>管理地区:</label>
 						<div class="layui-input-block  with-icon">
@@ -59,11 +73,80 @@
 													 cssStyle="background-color: #fff" title="区域" url="/sys/area/treeData" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="false"/>
 						</div>
 					</div>
-				</c:if>
+				</c:if>--%>
 
 			</div>
 		</form:form>
+		<div class="form-group layui-row">
+			<div class="form-group-label"><h2>人员信息</h2></div>
+			<form id="assignRoleForm" action="${ctx}/areaStaff/areaStaff/assignUser" method="post" class="hide">
+				<input type="hidden" name="id" value="${areaStaffInfo.id}"/>
+				<input type="hidden" name="office.id" value="${areaStaffInfo.office.id}"/>
+				<input id="idsArr" type="hidden" name="idsArr" value=""/>
+			</form>
+			<div class="layui-item layui-col-xs12 form-table-container" >
+				<table id="contentTable" class="table table-bordered table-condensed details">
+					<thead>
+					<tr>
+						<th>归属公司</th>
+						<th>归属部门</th>
+						<th>姓名</th>
+						<th>电话</th>
+						<th>手机</th>
+					</tr>
+					</thead>
+					<tbody>
+					<c:forEach items="${userList}" var="user">
+						<tr>
+							<td>${user.company.name}</td>
+							<td>${user.office.name}</td>
+							<td>${user.name}</td>
+							<td>${user.phone}</td>
+							<td>${user.mobile}</td>
+						</tr>
+					</c:forEach>
+					</tbody>
+				</table>
+			</div>
+		</div>
 	</div>
 </div>
+<script type="text/javascript">
+	$("#assignButton").click(function(){
+
+		top.layer.open({
+			type: 2,
+			area: ['90%','90%'],
+			title:"选择用户",
+			skin:"two-btns",
+			maxmin: true, //开启最大化最小化按钮
+			content: "${ctx}/areaStaff/areaStaff/getUserList?id=${areaStaffInfo.id}&office.id=${areaStaffInfo.office.id}" ,
+			btn: ['确定', '关闭'],
+			yes: function(index, layero){
+				var pre_ids = layero.find("iframe")[0].contentWindow.pre_ids;
+				var ids = layero.find("iframe")[0].contentWindow.ids;
+				if(ids[0]==''){
+					ids.shift();
+					pre_ids.shift();
+				}
+				if(pre_ids.sort().toString() == ids.sort().toString()){
+					top.$.jBox.tip("未分配人员信息!", 'info');
+					return false;
+				};
+				// 执行保存
+				//loading('正在提交,请稍等...');
+				var idsArr = "";
+				for (var i = 0; i<ids.length; i++) {
+					idsArr = (idsArr + ids[i]) + (((i + 1)== ids.length) ? '':',');
+				}
+				$('#idsArr').val(idsArr);
+				$('#assignRoleForm').submit();
+				top.layer.close(index);
+			},
+			cancel: function(index){
+			}
+		});
+	});
+</script>
 </body>
 </html>

+ 2 - 2
src/main/webapp/webpage/modules/signatureManagement/electronicSignature/ElectronicSignatureList.jsp

@@ -390,9 +390,9 @@
                             </c:if>
                         </shiro:hasPermission>
                         <button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
-                        <c:if test="${isArea != '1'}">
+                        <%--<c:if test="${isArea != '1'}">--%>
                             <button class="layui-btn layui-btn-sm layui-bg-blue" title="地区负责人申请" onclick="openDialogDis('地区负责人申请','${ctx}/districtDirectorApplication/districtDirectorApplication/form','95%','95%')">&nbsp;地区负责人申请</button>
-                        </c:if>
+                        <%--</c:if>--%>
                         <c:if test="${isArea == '1'}">
                             <button class="layui-btn layui-btn-sm layui-bg-blue" title="地区负责人申请详情" onclick="openDialogForm('地区负责人申请详情','${ctx}/districtDirectorApplication/districtDirectorApplication/ListByCreate','95%','95%','','关闭')">&nbsp;地区负责人申请详情</button>
                         </c:if>

+ 1 - 0
src/main/webapp/webpage/modules/signatureManagement/electronicSignature/directorApplicationForm.jsp

@@ -7,6 +7,7 @@
 	<script type="text/javascript">
         var validateForm;
         function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+        	console.log(obj)
             if(validateForm.form()){
 				var territory = $("#territory").val();
 				if (territory == null || "" == territory) {