فهرست منبع

报销类型管理页面

user5 4 سال پیش
والد
کامیت
eee01537ad

+ 3 - 4
src/main/java/com/jeeplus/modules/serialnum/service/SerialNumTplService.java

@@ -3,10 +3,7 @@
  */
 package com.jeeplus.modules.serialnum.service;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -112,6 +109,7 @@ public class SerialNumTplService extends CrudService<SerialNumTplDao, SerialNumT
             if ("0".equals(office.getParent().getId()))
                 office.setParent(null);
             String year = DateUtils.formatDate(new Date(), "yyyy");
+            String month = DateUtils.formatDate(new Date(), "MM");
 			if(!year.equals(numTpl.getYearBuilt())){
 				dao.resetSerialNum(numTpl.getId(),numTpl.getYearBuilt(),year);
 			}
@@ -137,6 +135,7 @@ public class SerialNumTplService extends CrudService<SerialNumTplDao, SerialNumT
             String branchShortname = UserUtils.getSysParam("branch_shortname", UserUtils.getUser());
             map.put("brspnm", StringUtils.isBlank(branchShortname)?"":branchShortname);
 			map.put("year",year);
+			map.put("month",month);
 			map.put("serialNum",sb.toString());
 			String serNum = StringUtils.renderString(serialTpl, map);
 			return serNum;

+ 26 - 0
src/main/java/com/jeeplus/modules/workreimbursement/dao/WorkReimbursementTypeDao.java

@@ -0,0 +1,26 @@
+package com.jeeplus.modules.workreimbursement.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.TreeDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author: 大猫
+ * @create: 2020-11-30 16:27
+ **/
+@MyBatisDao
+public interface WorkReimbursementTypeDao extends CrudDao<WorkReimbursementTypeInfo>, TreeDao<WorkReimbursementTypeInfo> {
+
+
+    List<WorkReimbursementTypeInfo> fingIds(@Param("parentIdSet") Set<String> parentIdSet, @Param("companyId") String companyId);
+    List<WorkReimbursementTypeInfo> fingByIds(@Param("parentIdSet") Set<String> parentIdSet, @Param("companyId") String companyId, @Param("parentIds") String parentIds);
+
+    String selectOrderNum(String parentId);
+
+    List<WorkReimbursementTypeInfo> getByDetail();
+}

+ 133 - 0
src/main/java/com/jeeplus/modules/workreimbursement/entity/WorkReimbursementTypeInfo.java

@@ -0,0 +1,133 @@
+package com.jeeplus.modules.workreimbursement.entity;
+
+import com.jeeplus.common.persistence.TreeEntity;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo;
+
+/**
+ * @author: 大猫
+ * @create: 2020-11-30 16:22
+ **/
+public class WorkReimbursementTypeInfo extends TreeEntity<WorkReimbursementTypeInfo> {
+
+    private static final long serialVersionUID = 1L;
+    private String standardDetail;		// 标准内容
+    private String parentIds;		// 所有父ID
+    private Byte maxDeduct;		// 最多扣分
+    private String orderNum;		// 排序
+    private String companyId;   //公司id
+    private String type;
+    private Integer proofread; //是否是校核
+
+
+    private String number;    //编号
+    private String name;      //名称
+    private String pid;       //父级id
+
+    public WorkReimbursementTypeInfo() {
+        super();
+    }
+
+    public WorkReimbursementTypeInfo(String id){
+        super(id);
+    }
+
+    @ExcelField(title="标准内容", align=2, sort=8)
+    public String getStandardDetail() {
+        return standardDetail;
+    }
+
+    public void setStandardDetail(String standardDetail) {
+        this.standardDetail = standardDetail;
+    }
+
+    @ExcelField(title="所有父ID", align=2, sort=9)
+    public String getParentIds() {
+        return parentIds;
+    }
+
+    public void setParentIds(String parentIds) {
+        this.parentIds = parentIds;
+    }
+
+    @ExcelField(title="最多扣分", align=2, sort=10)
+    public Byte getMaxDeduct() {
+        return maxDeduct;
+    }
+
+    public void setMaxDeduct(Byte maxDeduct) {
+        this.maxDeduct = maxDeduct;
+    }
+
+    @ExcelField(title="排序", align=2, sort=11)
+    public String getOrderNum() {
+        return orderNum;
+    }
+
+    public void setOrderNum(String orderNum) {
+        this.orderNum = orderNum;
+    }
+
+    public WorkReimbursementTypeInfo getParent() {
+        return parent;
+    }
+
+    public void setParent(WorkReimbursementTypeInfo parent) {
+        this.parent = parent;
+    }
+
+    public int getGrade(){
+        String[] split = this.getParentIds().split(",");
+        return split.length-1;
+    }
+
+    public String getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(String companyId) {
+        this.companyId = companyId;
+    }
+
+    public Integer getProofread() {
+        return proofread;
+    }
+
+    public void setProofread(Integer proofread) {
+        this.proofread = proofread;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getNumber() {
+        return number;
+    }
+
+    public void setNumber(String number) {
+        this.number = number;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPid() {
+        return pid;
+    }
+
+    public void setPid(String pid) {
+        this.pid = pid;
+    }
+}

+ 234 - 0
src/main/java/com/jeeplus/modules/workreimbursement/service/WorkReimbursementTypeService.java

@@ -0,0 +1,234 @@
+package com.jeeplus.modules.workreimbursement.service;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.service.TreeService;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryTree;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import com.jeeplus.modules.workreimbursement.dao.WorkReimbursementTypeDao;
+import com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+/**
+ * @author: 大猫
+ * @create: 2020-11-30 16:27
+ **/
+@Service
+@Transactional(readOnly = true)
+public class WorkReimbursementTypeService extends TreeService<WorkReimbursementTypeDao, WorkReimbursementTypeInfo> {
+    @Autowired
+    private WorkClientAttachmentDao workClientAttachmentDao;
+
+    public WorkReimbursementTypeInfo get(String id) {
+        return super.get(id);
+    }
+
+    /**
+     * 查询所有数据
+     * @param workReimbursementTypeInfo
+     * @return
+     */
+    public List<WorkReimbursementTypeInfo> findList(WorkReimbursementTypeInfo workReimbursementTypeInfo) {
+        List<WorkReimbursementTypeInfo> projectAccessoryInfoList = new ArrayList<>();
+        List<WorkReimbursementTypeInfo> listReturn = Lists.newArrayList();
+        //根据条件查询数据集合
+        List<WorkReimbursementTypeInfo> listAll = super.findList(workReimbursementTypeInfo);
+        Office company = UserUtils.getSelectCompany();
+        workReimbursementTypeInfo.setCompanyId(company.getId());
+        //根据条件查询数据集合
+        List<WorkReimbursementTypeInfo> list = super.findList(workReimbursementTypeInfo);
+        //判断,数据不为空则添加到返回集合中
+        if (listAll!=null && listAll.size()!=0){
+            projectAccessoryInfoList.addAll(listAll);
+        }
+        //判断,数据不为空则添加到返回集合中
+        if (list!=null && list.size()!=0){
+            projectAccessoryInfoList.addAll(list);
+        }
+
+        if(projectAccessoryInfoList!=null&&projectAccessoryInfoList.size()>0&&workReimbursementTypeInfo!=null&& (StringUtils.isNotBlank(workReimbursementTypeInfo.getStandardDetail())||StringUtils.isNotBlank(workReimbursementTypeInfo.getOrderNum()))){
+            //标准内容模糊查询,查询所有父节点
+            Set<String> parentIdSet = new HashSet<>();
+            for (WorkReimbursementTypeInfo projectAccessory : projectAccessoryInfoList) {
+                String parentIds = projectAccessory.getParentIds();
+                if (StringUtils.isNotBlank(parentIds)){
+                    parentIdSet.addAll(Arrays.asList(parentIds.split(",")));
+                }
+            }
+            for (WorkReimbursementTypeInfo reviewStandard : projectAccessoryInfoList) {
+                parentIdSet.remove(reviewStandard.getId());
+            }
+            projectAccessoryInfoList.addAll(0,this.fingIds(parentIdSet,"0"));
+            projectAccessoryInfoList.addAll(0,this.fingIds(parentIdSet,UserUtils.getSelectCompany().getId()));
+        }
+        sortList(listReturn,projectAccessoryInfoList,"0",true);
+        return listReturn;
+    }
+
+    public static void sortList(List<WorkReimbursementTypeInfo> list, List<WorkReimbursementTypeInfo> sourcelist, String parentId, boolean cascade){
+        for (int i=0; i<sourcelist.size(); i++){
+            WorkReimbursementTypeInfo e = sourcelist.get(i);
+            if (e.getParent()!=null && StringUtils.isNotBlank(e.getParent().getId()) && e.getParent().getId().equals(parentId)){
+                list.add(e);
+                if (cascade){
+                    // 判断是否还有子节点, 有则继续获取子节点
+                    for (int j=0; j<sourcelist.size(); j++){
+                        WorkReimbursementTypeInfo child = sourcelist.get(j);
+                        if (child.getParent()!=null && StringUtils.isNotBlank(child.getParent().getId()) && child.getParent().getId().equals(e.getId())){
+                            sortList(list, sourcelist, e.getId(), true);
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private List<WorkReimbursementTypeInfo> fingIds(Set<String> parentIdSet, String companyId) {
+        return dao.fingIds(parentIdSet,companyId);
+    }
+    private List<WorkReimbursementTypeInfo> fingByIds(Set<String> parentIdSet, String companyId, String parentIds) {
+        return dao.fingByIds(parentIdSet,companyId,parentIds);
+    }
+
+    public Page<WorkReimbursementTypeInfo> findPage(Page<WorkReimbursementTypeInfo> page, WorkReimbursementTypeInfo workReimbursementTypeInfo) {
+        return super.findPage(page, workReimbursementTypeInfo);
+    }
+
+    @Transactional(readOnly = false)
+    public void save(WorkReimbursementTypeInfo workReimbursementTypeInfo) {
+        //设置序号
+        if(workReimbursementTypeInfo.getIsNewRecord()) {
+            workReimbursementTypeInfo.setParent(this.get(workReimbursementTypeInfo.getParent().getId()));
+            String orderNum = null;
+            //判断是否选择了父级节点。没有选择则默认为第一级别
+            if(null != workReimbursementTypeInfo.getParent()){
+                orderNum = this.selectOrderNum(workReimbursementTypeInfo.getParent().getId());
+                workReimbursementTypeInfo.setCompanyId(UserUtils.getSelectCompany().getId());
+            }else{
+                orderNum = this.selectOrderNum("0");
+                workReimbursementTypeInfo.setCompanyId("0");
+            }
+            //判断是否有数据,没有数据则默认给编号01,有则在最大数据上递增1
+            if (StringUtils.isBlank(orderNum)) {
+                workReimbursementTypeInfo.setOrderNum(workReimbursementTypeInfo.getParent().getOrderNum() + "01");
+            } else {
+                workReimbursementTypeInfo.setOrderNum(String.valueOf(Integer.valueOf(orderNum) + 1));
+            }
+        }
+        super.save(workReimbursementTypeInfo);
+    }
+
+    @Transactional(readOnly = false)
+    public void delete(WorkReimbursementTypeInfo workReimbursementTypeInfo) {
+        super.delete(workReimbursementTypeInfo);
+    }
+
+
+    public String selectOrderNum(String parentId) {
+        return dao.selectOrderNum(parentId);
+    }
+
+
+    /**
+     * 查询第一级数据信息
+     * @param workReimbursementTypeInfo
+     * @return
+     */
+    public List<WorkReimbursementTypeInfo> findTreeList(WorkReimbursementTypeInfo workReimbursementTypeInfo) {
+        List<WorkReimbursementTypeInfo> workReviewStandards = new ArrayList<>();
+        List<WorkReimbursementTypeInfo> listReturn = Lists.newArrayList();
+        Office company = UserUtils.getSelectCompany();
+        workReimbursementTypeInfo.setCompanyId(company.getId());
+        List<WorkReimbursementTypeInfo> listAll = super.findList(workReimbursementTypeInfo);
+        /*workReviewStandard.setCompanyId(company.getId());
+        workReviewStandard.setProofread(1);
+        List<ProjectAccessoryInfo> list = super.findList(workReviewStandard);*/
+        if (listAll!=null && listAll.size()!=0){
+            workReviewStandards.addAll(listAll);
+        }
+        /*if (list!=null && list.size()!=0){
+            workReviewStandards.addAll(list);
+        }*/
+        sortList(listReturn,workReviewStandards,"0",true);
+        this.queryProofread(listReturn);
+        return listReturn;
+    }
+
+    public void queryProofread(List<WorkReimbursementTypeInfo> listReturn){
+        List<WorkReimbursementTypeInfo> standards = dao.getByDetail();
+        if(standards==null||listReturn==null){
+            return;
+        }
+        for (WorkReimbursementTypeInfo standard : standards) {
+            for (WorkReimbursementTypeInfo reviewStandard : listReturn) {
+                if(reviewStandard!=null&&((reviewStandard.getParent()!=null&&standard.getId().equals(reviewStandard.getParent().getId()))
+                        ||standard.getId().equals(reviewStandard.getId())
+                        || (StringUtils.isNotBlank(reviewStandard.getParentIds())&&reviewStandard.getParentIds().contains(standard.getId()))
+                )){
+                    reviewStandard.setProofread(1);
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 根据信息查询附件信息
+     * @param attachmentId
+     * @param projectId
+     * @return
+     */
+    public List<WorkClientAttachment> getWorkAttachments(String attachmentId, String projectId){
+        WorkClientAttachment attchment = new WorkClientAttachment();
+        attchment.setAttachmentId(attachmentId);
+        attchment.setProjectId(projectId);
+        List<WorkClientAttachment> attachments = workClientAttachmentDao.getList(attchment);
+        return attachments;
+    }
+
+    /**
+     * 新增修改删除附件信息
+     * @param projectAccessory
+     */
+    @Transactional(readOnly = false)
+    public void saveWorkAttachment(ProjectAccessoryTree projectAccessory){
+        //判断附件信息是否为空
+        if(null != projectAccessory.getWorkAttachments()){
+            for (WorkClientAttachment workClientAttachment : projectAccessory.getWorkAttachments()) {
+                //判断附件信息的id是否为空
+                if (workClientAttachment.getId() == null) {
+                    continue;
+                }
+                //判断附件信息是否是删除项
+                if (WorkClientAttachment.DEL_FLAG_NORMAL.equals(workClientAttachment.getDelFlag())) {
+                    //添加附件信息基本信息
+                    workClientAttachment.setAttachmentId(projectAccessory.getId());
+                    workClientAttachment.setProjectId(projectAccessory.getProjectId());
+                    workClientAttachment.setAttachmentUser(UserUtils.getUser().getId());
+                    if (StringUtils.isBlank(workClientAttachment.getId()) || "null".equals(workClientAttachment.getId())) {
+                        //新增附件信息
+                        workClientAttachment.preInsert();
+                        workClientAttachmentDao.insert(workClientAttachment);
+                    } else {
+                        //修改附件信息
+                        workClientAttachment.preUpdate();
+                        workClientAttachmentDao.update(workClientAttachment);
+                    }
+                } else {
+                    //删除附件信息
+                    workClientAttachmentDao.delete(workClientAttachment);
+                }
+            }
+        }
+    }
+}

+ 172 - 0
src/main/java/com/jeeplus/modules/workreimbursement/web/WorkReimbursementTypeController.java

@@ -0,0 +1,172 @@
+package com.jeeplus.modules.workreimbursement.web;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo;
+import com.jeeplus.modules.workreimbursement.service.WorkReimbursementTypeService;
+import org.apache.shiro.authz.annotation.Logical;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 报销类型管理
+ * @author: 大猫
+ * @create: 2020-11-30 16:20
+ **/
+@Controller
+@RequestMapping(value = "${adminPath}/reimbursementType/reimbursementType")
+public class WorkReimbursementTypeController extends BaseController {
+
+    @Autowired
+    private WorkReimbursementTypeService workReimbursementTypeService;
+
+    @ModelAttribute
+    public WorkReimbursementTypeInfo get(@RequestParam(required=false) String id) {
+        WorkReimbursementTypeInfo entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = workReimbursementTypeService.get(id);
+        }
+        if (entity == null){
+            entity = new WorkReimbursementTypeInfo();
+        }
+        return entity;
+    }
+
+    /**
+     * 报销类型列表页面
+     * @param workReimbursementTypeInfo
+     * @param model
+     * @return
+     */
+    @RequiresPermissions("reimbursementType:reimbursementType:list")
+    @RequestMapping(value = {"list", ""})
+    public String list(WorkReimbursementTypeInfo workReimbursementTypeInfo, Model model) {
+        List<WorkReimbursementTypeInfo> list = workReimbursementTypeService.findList(workReimbursementTypeInfo);
+        workReimbursementTypeService.queryProofread(list);
+        model.addAttribute("list", list);
+        return "modules/workReimbursementType/reimbursementTypeList";
+    }
+
+    /**
+     * 查看,增加,编辑报销类型表单页面
+     * @param workReimbursementTypeInfo
+     * @param model
+     * @return
+     */
+    @RequiresPermissions(value={"reimbursementType:reimbursementType:add","reimbursementType:reimbursementType:edit"},logical= Logical.OR)
+    @RequestMapping(value = "form")
+    public String form(WorkReimbursementTypeInfo workReimbursementTypeInfo, Model model) {
+        if(workReimbursementTypeInfo!=null&&workReimbursementTypeInfo.getParent()!=null&&StringUtils.isNotBlank(workReimbursementTypeInfo.getParent().getId())){
+            WorkReimbursementTypeInfo parent = workReimbursementTypeService.get(workReimbursementTypeInfo.getParent().getId());
+            workReimbursementTypeInfo.setParent(parent);
+            List<WorkReimbursementTypeInfo> list = new ArrayList<>();
+            list.add(workReimbursementTypeInfo);
+            workReimbursementTypeService.queryProofread(list);
+        }
+        model.addAttribute("workReimbursementTypeInfo", workReimbursementTypeInfo);
+        return "modules/workReimbursementType/reimbursementTypeForm";
+    }
+
+    /**
+     * 查看报销类型
+     * @param workReimbursementTypeInfo
+     * @param model
+     * @return
+     */
+    @RequiresPermissions(value={"reimbursementType:reimbursementType:view"},logical=Logical.OR)
+    @RequestMapping(value = "view")
+    public String view(WorkReimbursementTypeInfo workReimbursementTypeInfo, Model model) {
+        if(workReimbursementTypeInfo!=null&&workReimbursementTypeInfo.getParent()!=null&&StringUtils.isNotBlank(workReimbursementTypeInfo.getParent().getId())){
+            WorkReimbursementTypeInfo parent = workReimbursementTypeService.get(workReimbursementTypeInfo.getParent().getId());
+            workReimbursementTypeInfo.setParent(parent);
+            List<WorkReimbursementTypeInfo> list = new ArrayList<>();
+            list.add(workReimbursementTypeInfo);
+            workReimbursementTypeService.queryProofread(list);
+        }
+        model.addAttribute("workReimbursementTypeInfo", workReimbursementTypeInfo);
+        return "modules/workReimbursementType/reimbursementTypeView";
+    }
+
+    /**
+     * 保存报销类型
+     * @param workReimbursementTypeInfo
+     * @param model
+     * @param redirectAttributes
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions(value={"reimbursementType:reimbursementType:add","reimbursementType:reimbursementType:edit"},logical=Logical.OR)
+    @RequestMapping(value = "save")
+    public String save(WorkReimbursementTypeInfo workReimbursementTypeInfo, Model model, RedirectAttributes redirectAttributes) throws Exception{
+        if (!beanValidator(model, workReimbursementTypeInfo)){
+            return form(workReimbursementTypeInfo, model);
+        }
+        if(!workReimbursementTypeInfo.getIsNewRecord()){//编辑表单保存
+            WorkReimbursementTypeInfo t = workReimbursementTypeService.get(workReimbursementTypeInfo.getId());//从数据库取出记录的值
+            MyBeanUtils.copyBeanNotNull2Bean(workReimbursementTypeInfo, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+            workReimbursementTypeService.save(t);//保存
+        }else{//新增表单保存
+            workReimbursementTypeService.save(workReimbursementTypeInfo);//保存
+        }
+        addMessage(redirectAttributes, "保存报销类型成功");
+        return "redirect:"+ Global.getAdminPath()+"/reimbursementType/reimbursementType/?repage";
+    }
+
+    /**
+     * 删除报销类型
+     * @param workReimbursementTypeInfo
+     * @param redirectAttributes
+     * @return
+     */
+    @RequiresPermissions("reimbursementType:reimbursementType:del")
+    @RequestMapping(value = "delete")
+    public String delete(WorkReimbursementTypeInfo workReimbursementTypeInfo, RedirectAttributes redirectAttributes) {
+        workReimbursementTypeService.delete(workReimbursementTypeInfo);
+        addMessage(redirectAttributes, "删除报销类型成功");
+        return "redirect:"+Global.getAdminPath()+"/reimbursementType/reimbursementType/?repage";
+    }
+
+
+
+    /**
+     * 获取机构JSON数据。
+     *
+     * @param extId    排除的ID
+     * @return
+     */
+    @RequiresPermissions("user")
+    @ResponseBody
+    @RequestMapping(value = "treeData")
+    public List<Map<String, Object>> treeData(@RequestParam(required = false) String extId) {
+        List<Map<String, Object>> mapList = Lists.newArrayList();
+        List<WorkReimbursementTypeInfo> list = workReimbursementTypeService.findTreeList(new WorkReimbursementTypeInfo());
+        for (int i = 0; i < list.size(); i++) {
+            WorkReimbursementTypeInfo e = list.get(i);
+            if ((StringUtils.isBlank(extId) || (extId != null && !extId.equals(e.getId()) && e.getParentIds().indexOf("," + extId + ",") == -1)) ) {
+                Map<String, Object> map = Maps.newHashMap();
+                map.put("id", e.getId());
+                map.put("pId", e.getParentId());
+                map.put("pIds", e.getParentIds());
+                map.put("name", e.getStandardDetail());
+                map.put("grade", e.getGrade());
+                mapList.add(map);
+            }
+        }
+        return mapList;
+    }
+}

+ 190 - 0
src/main/resources/mappings/modules/workreimbursement/WorkReimbursementTypeDao.xml

@@ -0,0 +1,190 @@
+<?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.jeeplus.modules.workreimbursement.dao.WorkReimbursementTypeDao">
+    
+	<sql id="workReviewStandardColumns">
+		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.parent_id AS "parent.id",
+		a.standard_detail AS "standardDetail",
+		a.parent_ids AS "parentIds",
+		a.company_id AS "companyId",
+		a.order_num AS "orderNum"
+	</sql>
+	
+    
+	<select id="get" resultType="com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo" >
+		SELECT 
+			<include refid="workReviewStandardColumns"/>
+		FROM work_reimbursement_type_info a
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo" >
+		SELECT 
+			<include refid="workReviewStandardColumns"/>
+		FROM work_reimbursement_type_info a
+		<where>
+            <if test="standardDetail!=null and standardDetail != ''">
+                and a.standard_detail like concat('%',#{standardDetail},'%')
+            </if>
+            <if test="parentIds!=null and parentIds != ''">
+                and a.parent_ids like concat('%',#{parentIds},'%')
+            </if>
+            <choose>
+				<when test="companyId!=null and companyId != ''">
+					and a.company_id = #{companyId}
+				</when>
+				<otherwise>
+					and a.company_id = '0'
+				</otherwise>
+			</choose>
+            <if test="orderNum != null and orderNum!=0">
+                and a.order_num = #{orderNum}
+            </if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.order_num
+			</otherwise>
+		</choose>
+	</select>
+	
+	<select id="findAllList" resultType="com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo" >
+		SELECT 
+			<include refid="workReviewStandardColumns"/>
+		FROM work_reimbursement_type_info a
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+	
+	<insert id="insert">
+		INSERT INTO work_reimbursement_type_info(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
+			del_flag,
+			parent_id,
+			standard_detail,
+			parent_ids,
+			company_id,
+			order_num
+		) VALUES (
+			#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+			#{parent.id},
+			#{standardDetail},
+			#{parentIds},
+			#{companyId},
+			#{orderNum}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE work_reimbursement_type_info SET
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks},
+			parent_id = #{parent.id},
+			standard_detail = #{standardDetail},
+			parent_ids = #{parentIds},
+			company_id = #{companyId},
+			order_num = #{orderNum}
+		WHERE id = #{id}
+	</update>
+	
+	
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM work_reimbursement_type_info
+		WHERE id = #{id} OR find_in_set(#{id},parent_ids)
+	</update>
+	
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE work_reimbursement_type_info SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id} OR find_in_set(#{id},parent_ids)
+	</update>
+	
+	
+	<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
+	<select id="findUniqueByProperty" resultType="com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo" statementType="STATEMENT">
+		select * FROM work_reimbursement_type_info  where ${propertyName} = '${value}'
+	</select>
+
+    <select id="fingIds" resultType="com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo">
+        SELECT <include refid="workReviewStandardColumns"/>
+        FROM work_reimbursement_type_info a
+        <where>
+            <if test="parentIdSet!=null and parentIdSet.size!=0">
+                a.id in
+                <foreach collection="parentIdSet" item="parentId" separator="," open="(" close=")">
+                      #{parentId}
+                </foreach>
+            </if>
+            AND del_flag ='0'
+			AND company_id = #{companyId}
+        </where>
+        ORDER BY a.order_num
+    </select>
+    <select id="fingByIds" resultType="com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo">
+        SELECT <include refid="workReviewStandardColumns"/>
+        FROM work_reimbursement_type_info a
+        <where>
+            <if test="parentIdSet!=null and parentIdSet.size!=0">
+                a.id in
+                <foreach collection="parentIdSet" item="parentId" separator="," open="(" close=")">
+                      #{parentId}
+                </foreach>
+            </if>
+            AND del_flag ='0'
+			AND company_id = #{companyId}
+			AND parent_ids like concat('%',#{parentIds},'%')
+        </where>
+        ORDER BY a.order_num
+    </select>
+
+    <select id="selectOrderNum" resultType="java.lang.String">
+        SELECT MAX(order_num) FROM work_reimbursement_type_info WHERE parent_id = #{parentId}
+    </select>
+
+    <select id="getByDetail" resultType="com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo">
+        SELECT * FROM work_reimbursement_type_info WHERE standard_detail = '标准部校核'
+    </select>
+
+	<select id="findByParentIdsLike" resultType="com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryInfo">
+		SELECT
+		<include refid="workReviewStandardColumns"/>
+		FROM work_reimbursement_type_info a
+		WHERE a.del_flag = #{DEL_FLAG_NORMAL} AND (a.parent_ids LIKE
+		<if test="dbName == 'mysql'">concat('%,',#{parentIds},',%')</if>
+		OR a.id = #{id})
+		ORDER BY a.order_num
+	</select>
+</mapper>

+ 5 - 0
src/main/webapp/webpage/modules/serialnum/serialNumTplForm.jsp

@@ -243,6 +243,11 @@
 									$(valueId).val("{serialNum}");
 									break;
 								}
+								case "9": {
+									$(valueId).val("{month}");
+									$(exId).val(new Date().getMonth()+1);
+									break;
+								}
 							}
 
 						}

+ 97 - 0
src/main/webapp/webpage/modules/workReimbursementType/reimbursementTypeForm.jsp

@@ -0,0 +1,97 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>报销内容管理</title>
+	<meta name="decorator" content="default"/>
+	<style>
+		label.error{
+			top:40px;
+			left:0;
+		}
+		#standardDetail-error{
+			top:82px;
+			left:0;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+			  $("#inputForm").submit();
+			  return true;
+		  }
+	
+		  return false;
+		}
+		$(document).ready(function() {
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+            var edit = "${workReviewStandard.id}";
+            if(edit!=null && edit!=''){
+                $("#reviewParentButton").attr("disabled","disabled");
+            }
+            setParentInfo($("#reviewParentId").val());
+		});
+        function setParentInfo(parentId){
+            $.ajax({
+                url:"${ctx}/reimbursementType/reimbursementType/jsonData",
+                dataType:"json",
+                data:{id:parentId},
+                success:function (data) {
+                    if(data.proofread==1&&data.grade==1){
+                        $("#maxDeductTr").show();
+                    }else {
+                        $("#maxDeductTr").hide();
+                    }
+                }
+            })
+        }
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+		<form:form id="inputForm" modelAttribute="workReimbursementTypeInfo" action="${ctx}/reimbursementType/reimbursementType/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<form:hidden path="companyId"/>
+			<div class="form-group layui-row first">
+				<div class="form-group-label"><h2>报销内容信息</h2></div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">上级节点:</label>
+					<div class="layui-input-block with-icon">
+						<sys:treeselectAccessory id="reviewParent" name="parent.id" value="${workReimbursementTypeInfo.parent.id}" labelName="parent.name" labelValue="${workReimbursementTypeInfo.parent.standardDetail}"
+											  title="附件结构" url="/reimbursementType/reimbursementType/treeData" extId="${workReimbursementTypeInfo.id}"  cssClass="form-control  layui-input" allowClear="${workReimbursementTypeInfo.currentUser.admin}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label double-line"><span class="require-item">*</span>报销内容名称:</label>
+					<div class="layui-input-block">
+						<form:input path="standardDetail" htmlEscape="false" class="form-control layui-input required"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">序号:</label>
+					<div class="layui-input-block">
+						<form:input path="orderNum" htmlEscape="false"  readonly="true"  class="form-control layui-input"/>
+					</div>
+				</div>
+			</div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 138 - 0
src/main/webapp/webpage/modules/workReimbursementType/reimbursementTypeList.jsp

@@ -0,0 +1,138 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>报销内容管理</title>
+    <meta name="decorator" content="default"/>
+    <%@include file="/webpage/include/treetable.jsp" %>
+    <script type="text/javascript">
+        $(document).ready(function() {
+            $("#treeTable").treeTable({expandLevel : 5},{ expandable: true });
+        });
+    </script>
+	<style>
+		body{
+			background-color:transparent;
+			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+			color:#ffffff;
+			background-color:rgba(255,255,255,0);
+			height:100%;
+		}
+	</style>
+</head>
+<body >
+	<div class="wrapper wrapper-content">
+		<sys:message content="${message}"/>
+		<div class="layui-row">
+			<div class="full-width fl">
+				<div class="contentShadow layui-row" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="workReimbursementTypeInfo" action="${ctx}/reimbursementType/reimbursementType/" method="post" class="form-inline">
+
+					<div class="commonQuery">
+						<div class="layui-item query athird">
+							<label class="layui-form-label double-line">报销内容名:</label>
+							<div class="layui-input-block with-icon">
+								<form:input path="standardDetail" htmlEscape="false" class=" form-control layui-input"></form:input>
+							</div>
+						</div>
+						<div class="layui-item query athird">
+							<label class="layui-form-label">序号:</label>
+							<div class="layui-input-block">
+								<form:input path="orderNum" htmlEscape="false" class=" form-control layui-input"></form:input>
+							</div>
+						</div>
+						<div class="layui-item athird">
+							<div class="input-group">
+								<button id="searchReset" style="margin-right: 10px;" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
+								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
+							</div>
+						</div>
+						<div style="    clear:both;"></div>
+					</div>
+
+					</form:form>
+				</div>
+			</div>
+			<div class="full-width fl">
+				<div class="contentShadow layui-form contentDetails">
+					<div class="nav-btns">
+						<shiro:hasPermission name="reimbursementType:reimbursementType:add">
+							<table:addRow url="${ctx}/reimbursementType/reimbursementType/form" title="项目"></table:addRow><!-- 增加按钮 -->
+						</shiro:hasPermission>
+						<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
+						<div style="clear: both;"></div>
+					</div>
+
+	
+					<!-- 表格 -->
+					<table id="treeTable" class="table table-bordered table-hover list-table">
+						<thead>
+							<tr>
+								<th  width="40%">报销内容名称</th>
+								<th >序号</th>
+								<th width="240px">操作</th>
+							</tr>
+						</thead>
+						<tbody>
+						<c:forEach items="${list}" var="workReimbursementTypeInfo">
+							<tr id="${workReimbursementTypeInfo.id}" pid="${workReimbursementTypeInfo.parent.id}">
+								<td><a  href="#" onclick="openDialogView('查看报销内容', '${ctx}/reimbursementType/reimbursementType/view?id=${workReimbursementTypeInfo.id}','80%', '60%')">
+										${workReimbursementTypeInfo.standardDetail}
+								</a></td>
+								<td style="text-align: center">
+									${workReimbursementTypeInfo.orderNum}
+								</td>
+								<td class="op-td text-center">
+									<div class="op-btn-box">
+										<c:if test="${workReimbursementTypeInfo.grade == 0}">
+											<shiro:hasPermission name="reimbursementType:reimbursementType:add">
+												<a href="javascript:void(0);" onclick="openDialog('添加报销内容', '${ctx}/reimbursementType/reimbursementType/form?parent.id=${workReimbursementTypeInfo.id}','80%','60%')" class="op-btn op-btn-add"><i class="fa fa-plus"></i> 添加下级结构</a>
+											</shiro:hasPermission>
+											<%--<shiro:hasPermission name="reimbursementType:reimbursementType:edit">
+												<a href="javascript:void(0);" onclick="openDialog('修改报销内容', '${ctx}/reimbursementType/reimbursementType/form?id=${workReimbursementTypeInfo.id}','80%','60%')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 修改</a>
+											</shiro:hasPermission>
+											<shiro:hasPermission name="reimbursementType:reimbursementType:del">
+												<a href="${ctx}/reimbursementType/reimbursementType/delete?id=${workReimbursementTypeInfo.id}" onclick="return confirmx('确认要删除该报销内容吗?', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>
+											</shiro:hasPermission>--%>
+										</c:if>
+										<c:if test="${workReimbursementTypeInfo.grade ==1}">
+											<shiro:hasPermission name="reimbursementType:reimbursementType:add">
+												<a href="javascript:void(0);" onclick="openDialog('添加报销内容', '${ctx}/reimbursementType/reimbursementType/form?parent.id=${workReimbursementTypeInfo.id}','80%','60%')" class="op-btn op-btn-add"><i class="fa fa-plus"></i> 添加下级结构</a>
+											</shiro:hasPermission>
+											<shiro:hasPermission name="reimbursementType:reimbursementType:edit">
+												<a href="javascript:void(0);" onclick="openDialog('修改报销内容', '${ctx}/reimbursementType/reimbursementType/form?id=${workReimbursementTypeInfo.id}','80%','60%')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 修改</a>
+											</shiro:hasPermission>
+											<shiro:hasPermission name="reimbursementType:reimbursementType:del">
+												<a href="${ctx}/reimbursementType/reimbursementType/delete?id=${workReimbursementTypeInfo.id}" onclick="return confirmx('确认要删除该报销内容吗?', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>
+											</shiro:hasPermission>
+										</c:if>
+										<c:if test="${workReimbursementTypeInfo.grade ==2}">
+											<shiro:hasPermission name="reimbursementType:reimbursementType:edit">
+												<a href="javascript:void(0);" onclick="openDialog('修改报销内容', '${ctx}/reimbursementType/reimbursementType/form?id=${workReimbursementTypeInfo.id}','80%','60%')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 修改</a>
+											</shiro:hasPermission>
+											<shiro:hasPermission name="reimbursementType:reimbursementType:del">
+												<a href="${ctx}/reimbursementType/reimbursementType/delete?id=${workReimbursementTypeInfo.id}" onclick="return confirmx('确认要删除该报销内容吗?', this.href)"   class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 删除</a>
+											</shiro:hasPermission>
+										</c:if>
+									</div>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+	
+		<!-- 分页代码 -->
+	<%--<table:page page="${page}"></table:page>--%>
+
+				</div>
+			</div>
+		</div>
+</div>
+	<script>
+        resizeListWindow1();
+        $(window).resize(function(){
+            resizeListWindow1();
+        });
+	</script>
+</body>
+</html>

+ 68 - 0
src/main/webapp/webpage/modules/workReimbursementType/reimbursementTypeView.jsp

@@ -0,0 +1,68 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>复核标准管理</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+			  $("#inputForm").submit();
+			  return true;
+		  }
+
+		  return false;
+		}
+		$(document).ready(function() {
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+		});
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container view-form">
+		<form:form id="inputForm" modelAttribute="workReimbursementTypeInfo" action="#" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+
+			<div class="form-group layui-row first">
+				<div class="form-group-label"><h2>标准信息</h2></div>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label"><span class="require-item">*</span>上级节点:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workReimbursementTypeInfo.parent.standardDetail}"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12 with-textarea">
+					<label class="layui-form-label"><span class="require-item">*</span>报销内容:</label>
+					<div class="layui-input-block">
+						<textarea htmlEscape="false" readonly="true" rows="4" style="resize:none;" class="form-control required">${workReimbursementTypeInfo.standardDetail}</textarea>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm12">
+					<label class="layui-form-label">序号:</label>
+					<div class="layui-input-block">
+						<input htmlEscape="false" readonly="true" class="form-control layui-input" value=" ${workReimbursementTypeInfo.orderNum}"/>
+					</div>
+				</div>
+
+			</div>
+		</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 7 - 0
src/main/webapp/webpage/modules/workreimbursement/workReimbursementFormAdd.jsp

@@ -531,6 +531,13 @@
                         <%--<input type="text" name="title" lay-verify="title" autocomplete="off" readonly="true" placeholder="" class="layui-input" value="全过程管理用户01">--%>
                 </div>
             </div>
+            <div class="layui-item layui-col-sm6">
+                <label class="layui-form-label">报销类型:</label>
+                <div class="layui-input-block with-icon">
+                    <sys:treeselect id="officeId" name="officeId" value="${workReimbursement.officeId}" labelName="officeName" labelValue="${workReimbursement.officeName}"
+                                    title="部门" url="/sys/office/treeDataAll?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+                </div>
+            </div>
 
             <div class="layui-item layui-col-sm6 td1">
                 <label class="layui-form-label"><span class="require-item">*</span>报销项目:</label>

+ 2 - 2
src/main/webapp/webpage/modules/workreimbursement/workReimbursementList.jsp

@@ -96,7 +96,7 @@
                             <div class="layui-input-block">
                                 <form:select path="status" class="form-control simple-select">
                                     <form:option value="" label=""/>
-                                    <form:options items="${fns:getDictList('audit_state')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
+                                    <form:options items="${fns:getDictList('reimburse_audit_state')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                                 </form:select>
                             </div>
                         </div>
@@ -161,7 +161,7 @@
                         return "<span title='"+ d.projectLeader +"'>" + d.projectLeader + "</span>";
                     }}
                 ,*/{field:'submitterDate', align:'center',title: '报销日期',width:80}
-                ,{field:'money',align:'center', title: '报销金额', width:100,templet:function(d){
+                ,{field:'money',align:'center', title: '报销金额(元)', width:150,templet:function(d){
                         return "<span title='"+ d.money +"'>" + d.money + "</span>";
                     }}
                 ,{ title: '状态', align:'center',width:70,templet:function(d){