Sfoglia il codice sorgente

项目管理导入接口

lizhenhao 2 anni fa
parent
commit
d8cf74b26b

+ 4 - 3
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/core/excel/utils/EasyPoiUtil.java

@@ -273,13 +273,14 @@ public class EasyPoiUtil {
      * @param file       上传的文件
      * @param titleRows  表标题的行数
      * @param headerRows 表头行数
+     * @param sheetNum   开始sheet页
      * @param sheetNum   sheet页数
      * @param pojoClass  Excel实体类
      * @return
      * @author Steel.D
      * @Date 2019-7-31 11:30
      */
-    public static <T> List <T> importSheetExcel(MultipartFile file, Integer titleRows, Integer headerRows, Integer sheetNum, Class <T> pojoClass) {
+    public static <T> List <T> importSheetExcel(MultipartFile file, Integer titleRows, Integer headerRows, Integer startSheetIndex, Integer sheetNum, Class <T> pojoClass) {
 
         if ( file == null ) {
 
@@ -293,9 +294,9 @@ public class EasyPoiUtil {
 
         params.setHeadRows ( headerRows );
 
-        params.setSheetNum(sheetNum);
-
+        params.setStartSheetIndex(startSheetIndex);
 
+        params.setSheetNum(sheetNum);
 
         List <T> list = null;
 

+ 38 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/constant/enums/ProjectTypeEnum.java

@@ -0,0 +1,38 @@
+package com.jeeplus.sys.constant.enums;
+
+/**
+ * 项目类型
+ */
+public enum ProjectTypeEnum {
+
+    ASSESS ("1", "评估项目"),
+    CONSULTATION ("2", "咨询项目");
+
+    /**
+     *  项目类型值
+     */
+    private String value;
+
+    /**
+     * 项目类型标签
+     */
+    private String label;
+
+    private ProjectTypeEnum(String value, String label) {
+        this.value = value;
+        this.label = label;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getLabel() {
+        return label;
+    }
+
+    @Override
+    public String toString() {
+        return this.value;
+    }
+}

+ 38 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/constant/enums/YesOrNoEnum.java

@@ -0,0 +1,38 @@
+package com.jeeplus.sys.constant.enums;
+
+/**
+ * 是否枚举
+ */
+public enum YesOrNoEnum {
+
+    YES ("1", "是"),
+    NO ("0", "否");
+
+    /**
+     *  枚举值
+     */
+    private String value;
+
+    /**
+     * 枚举标签
+     */
+    private String label;
+
+    private YesOrNoEnum(String value, String label) {
+        this.value = value;
+        this.label = label;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getLabel() {
+        return label;
+    }
+
+    @Override
+    public String toString() {
+        return this.value;
+    }
+}

+ 217 - 19
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/UserProjectController.java

@@ -2,6 +2,7 @@ package com.jeeplus.sys.controller;
 
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import com.aliyun.oss.ServiceException;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -14,6 +15,9 @@ import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.security.util.SecurityUtils;
 import com.jeeplus.sys.constant.enums.ProjectStatusEnum;
+import com.jeeplus.sys.constant.enums.ProjectTypeEnum;
+import com.jeeplus.sys.constant.enums.YesOrNoEnum;
+import com.jeeplus.sys.domain.User;
 import com.jeeplus.sys.domain.UserProject;
 import com.jeeplus.sys.service.UserProjectService;
 import com.jeeplus.sys.service.UserService;
@@ -21,6 +25,7 @@ import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.service.dto.UserProjectDTO;
 import com.jeeplus.sys.service.mapstruct.UserProjectWrapper;
 import com.jeeplus.sys.service.mapstruct.UserWrapper;
+import com.jeeplus.sys.utils.UserUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.time.DateUtils;
@@ -31,11 +36,14 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.ConstraintViolationException;
 import javax.validation.Valid;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 
 
@@ -56,12 +64,16 @@ public class UserProjectController {
     @Autowired
     private UserService userService;
 
+    private int successNum;
+
     @ApiLog("查询项目列表")
     @PreAuthorize("hasAuthority('sys:project:list')")
     @GetMapping("list")
     public ResponseEntity<IPage<UserProject>> data(UserProject userProject, Page<UserProject> page) throws Exception {
         QueryWrapper<UserProject> queryWrapper = QueryWrapperGenerator.buildQueryCondition (userProject, UserProject.class);
-        IPage<UserProject> result = userProjectService.page (page, queryWrapper);
+        queryWrapper.lambda().eq(StrUtil.isNotEmpty(userProject.getItemType()),UserProject::getItemType,userProject.getItemType());
+        IPage<UserProject> result = userProjectService.selectPage (userProject);
+
         return ResponseEntity.ok (result);
     }
 
@@ -90,9 +102,58 @@ public class UserProjectController {
         //新增或编辑表单保存
         UserProject project = UserProjectWrapper.INSTANCE.toEntity (projectDTO);
         UserProject pro = userProjectService.projectDtoToDate(project,projectDTO);
+        pro.setItemType(projectDTO.getItemType());
+
+        if(StrUtil.isNotEmpty(projectDTO.getProjectHead())){
+            String userId = userService.getUserIdByLogin(projectDTO.getProjectHead());
+            if(StrUtil.isNotEmpty(userId)){
+                pro.setProjectHead(userId);
+            }else{
+                pro.setProjectHead("");
+            }
+
+        }
+
+        if(StrUtil.isNotEmpty(projectDTO.getEvaluationPersonOne())){
+            String userId = userService.getUserIdByLogin(projectDTO.getEvaluationPersonOne());
+            if(StrUtil.isNotEmpty(userId)){
+                pro.setEvaluationPersonOne(userId);
+            }else{
+                pro.setEvaluationPersonOne("");
+            }
+        }
+
+        if(StrUtil.isNotEmpty(projectDTO.getEvaluationPersonTwo())){
+            String userId = userService.getUserIdByLogin(projectDTO.getEvaluationPersonTwo());
+            if(StrUtil.isNotEmpty(userId)){
+                pro.setEvaluationPersonTwo(userId);
+            }else{
+                pro.setEvaluationPersonTwo("");
+            }
+        }
+
         if(StrUtil.isEmpty(projectDTO.getId())){
+
+            //判断一下文号是否存在
+            if(StrUtil.isNotEmpty(projectDTO.getDocumentNum())){
+                if(ObjectUtil.isNotEmpty(userProjectService.selectByDocumentNum(projectDTO.getDocumentNum()))){
+                    return ResponseEntity.badRequest().body("不可使用已存在的文号");
+                }
+            }
+
             userProjectService.save(pro);//新增
         }else{
+
+            //判断一下文号是否存在
+            if(StrUtil.isNotEmpty(projectDTO.getDocumentNum())){
+                UserProject userProjects = userProjectService.selectByDocumentNum(projectDTO.getDocumentNum());
+                if(ObjectUtil.isNotEmpty(userProjects)){
+                    if(!projectDTO.getId().equals(userProjects.getId())){
+                        return ResponseEntity.badRequest().body("不可使用已存在的文号");
+                    }
+                }
+            }
+
             LambdaUpdateWrapper<UserProject> wrapper = userProjectService.getLambdaUpdateWrapper(projectDTO);
             userProjectService.update (pro,wrapper);//修改
         }
@@ -123,16 +184,47 @@ public class UserProjectController {
     @PreAuthorize("hasAnyAuthority('sys:project:import')")
     @PostMapping("import")
     @ApiOperation(value = "导入项目数据excel")
-    public ResponseEntity importFile(MultipartFile file) throws ParseException {
-        int successNum = 0;
-        List<UserProjectDTO> list = EasyPoiUtil.importSheetExcel(file, 1, 1, 1, UserProjectDTO.class);
+    public ResponseEntity importFile(MultipartFile file) {
+
+        this.successNum = 0;
+
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        ArrayList<UserProject> arrayList = new ArrayList<>();
+        HashMap<String,String> hashMap = new HashMap<>();
+
+        //评估项目sheet1
+        List<UserProjectDTO> listA = EasyPoiUtil.importSheetExcel(file, 1, 1, 0,1, UserProjectDTO.class);
+
+        String resultA = importDecide(listA, sdf, arrayList, hashMap, successNum, ProjectTypeEnum.ASSESS.getValue());
+        if(StrUtil.isNotEmpty(resultA)){
+            return ResponseEntity.badRequest().body  (resultA);
+        }
+
+        //咨询项目sheet2
+        List<UserProjectDTO> listB = EasyPoiUtil.importSheetExcel(file, 1, 1, 1,1, UserProjectDTO.class);
+
+        String resultB = importDecide(listB, sdf, arrayList, hashMap, successNum, ProjectTypeEnum.CONSULTATION.getValue());
+        if(StrUtil.isNotEmpty(resultB)){
+            return ResponseEntity.badRequest().body  (resultB);
+        }
+
+        if(hashMap.size() != listA.size() + listB.size()){
+            return ResponseEntity.badRequest().body  ("文件中存在重复的文号或者多个空文号");
+        }
+
+        userProjectService.saveBatch(arrayList);
+
+        return ResponseEntity.ok("已成功导入 " + successNum + " 条数据");
+    }
+    public String importDecide(List<UserProjectDTO> list,SimpleDateFormat sdf,ArrayList<UserProject> arrayList,HashMap<String,String> hashMap,int successNum,String itemType){
+
         for (UserProjectDTO project : list) {
 
             try {
                 if(StrUtil.isNotEmpty(project.getEvaluationReportDateUi())){
                     String format = sdf.format(DateUtils.parseDate(project.getEvaluationReportDateUi(), new String[]{"yyyy/MM/dd"}));
                     project.setEvaluationReportDate(sdf.parse(format));
+                    project.setStatus(ProjectStatusEnum.FINISH.getValue());
                 }
             }catch (Exception e){
                 if(StrUtil.isNotEmpty(project.getEvaluationReportDateUi())){
@@ -168,29 +260,135 @@ public class UserProjectController {
                     project.setInvoiceMessage(project.getInvoiceDateUi());
             }
 
+            try {
+                if(StrUtil.isNotEmpty(project.getReimbursementDateUi())){
+                    String format = sdf.format(DateUtils.parseDate(project.getReimbursementDateUi(), new String[]{"yyyy/MM/dd"}));
+                    project.setReimbursementDate(sdf.parse(format));
+                }
+            }catch (Exception e){
+                e.printStackTrace();
+            }
+
             //项目负责人、签字评估师1、签字评估师2 关联user表的id
-            if(StrUtil.isNotBlank(project.getProjectHead())){
-                project.setProjectHead(userService.getUserByLoginName(project.getProjectHead()).getId());
-            }else{
-                project.setProjectHead("");
+            if(StrUtil.isNotEmpty(project.getProjectHead())){
+                String id = userService.getUserIdByLogin(project.getProjectHead());
+                if(StrUtil.isNotEmpty(id)){
+                    project.setProjectHead(id);
+                }else{
+                    project.setProjectHead("");
+                }
             }
 
-            if(StrUtil.isNotBlank(project.getEvaluationPersonOne())){
-                project.setEvaluationPersonOne(userService.getUserByLoginName(project.getEvaluationPersonOne()).getId());
-            }else{
-                project.setEvaluationPersonOne("");
+            if(StrUtil.isNotEmpty(project.getEvaluationPersonOne())){
+                String id = userService.getUserIdByLogin(project.getEvaluationPersonOne());
+                if(ObjectUtil.isNotEmpty(id)){
+                    project.setEvaluationPersonOne(id);
+                }else{
+                    project.setEvaluationPersonOne("");
+                }
             }
 
-            if(StrUtil.isNotBlank(project.getEvaluationPersonTwo())){
-                project.setEvaluationPersonTwo(userService.getUserByLoginName(project.getEvaluationPersonTwo()).getId());
-            }else{
-                project.setEvaluationPersonTwo("");
+            if(StrUtil.isNotEmpty(project.getEvaluationPersonTwo())){
+                String id = userService.getUserIdByLogin(project.getEvaluationPersonTwo());
+                if(ObjectUtil.isNotEmpty(id)){
+                    project.setEvaluationPersonTwo(id);
+                }else{
+                    project.setEvaluationPersonTwo("");
+                }
             }
 
+            //文号的问题
+            if(StrUtil.isNotEmpty(project.getDocumentNum())) {
+                UserProject userProject = userProjectService.selectByDocumentNum(project.getDocumentNum());
+                if(ObjectUtil.isNotEmpty(userProject)){
+                    return "文件中存在已在档的文号";
+                }
+            }
+
+            //是否开票
+            if(YesOrNoEnum.YES.getLabel().equals(project.getIsInvoice())){
+                project.setIsInvoice(YesOrNoEnum.YES.getValue());
+            }else if(YesOrNoEnum.NO.getLabel().equals(project.getIsInvoice())){
+                project.setIsInvoice(YesOrNoEnum.NO.getValue());
+            }
+
+            //合同是否存档
+            if(YesOrNoEnum.YES.getLabel().equals(project.getIsContractArchive())){
+                project.setIsContractArchive(YesOrNoEnum.YES.getValue());
+            }else if(YesOrNoEnum.NO.getLabel().equals(project.getIsContractArchive())){
+                project.setIsContractArchive(YesOrNoEnum.NO.getValue());
+            }
 
-            userProjectService.save(UserProjectWrapper.INSTANCE.toEntity(project));
-            successNum++;
+            //底稿是否完好
+            if(YesOrNoEnum.YES.getLabel().equals(project.getIsPapersIntact())){
+                project.setIsPapersIntact(YesOrNoEnum.YES.getValue());
+            }else if(YesOrNoEnum.NO.getLabel().equals(project.getIsPapersIntact())){
+                project.setIsPapersIntact(YesOrNoEnum.NO.getValue());
+            }
+
+            //底稿是否归档
+            if(YesOrNoEnum.YES.getLabel().equals(project.getIsPapersArchive())){
+                project.setIsPapersArchive(YesOrNoEnum.YES.getValue());
+            }else if(YesOrNoEnum.NO.getLabel().equals(project.getIsPapersArchive())){
+                project.setIsPapersArchive(YesOrNoEnum.NO.getValue());
+            }
+
+            //外勤是否已经报销
+            if(YesOrNoEnum.YES.getLabel().equals(project.getIsOpsReimbursement())){
+                project.setIsOpsReimbursement(YesOrNoEnum.YES.getValue());
+            }else if(YesOrNoEnum.NO.getLabel().equals(project.getIsOpsReimbursement())){
+                project.setIsOpsReimbursement(YesOrNoEnum.NO.getValue());
+            }
+
+            //是否已经报销提成
+            if(YesOrNoEnum.YES.getLabel().equals(project.getIsCommissionReimbursement())){
+                project.setIsCommissionReimbursement(YesOrNoEnum.YES.getValue());
+            }else if(YesOrNoEnum.NO.getLabel().equals(project.getIsCommissionReimbursement())){
+                project.setIsCommissionReimbursement(YesOrNoEnum.NO.getValue());
+            }
+
+            hashMap.put(project.getDocumentNum(),null);
+
+            UserProject userProject = UserProjectWrapper.INSTANCE.toEntity(project);
+            //项目类型 1.评估项目  2.咨询项目
+            userProject.setItemType(itemType);
+            arrayList.add(userProject);
+            this.successNum++;
         }
-        return ResponseEntity.ok("已成功导入 " + successNum + " 条数据");
+
+        return null;
     }
+
+
+    /**
+     * 下载导入项目数据模板
+     *
+     * @param response
+     * @return
+     */
+    @PreAuthorize ("hasAnyAuthority('sys:project:import')")
+    @GetMapping("import/template/assess")
+    @ApiOperation(value = "下载模板")
+    public void importFileTemplateAssess(HttpServletResponse response) {
+        String fileName = "项目数据导入模板.xlsx";
+        List<UserProjectDTO> list = Lists.newArrayList();
+        EasyPoiUtil.exportExcel ( list, "2021年资产评估项目备查登记表",  "项目明细表", UserProjectDTO.class, fileName, response );
+    }
+
+
+    /**
+     * 下载导入项目数据模板
+     *
+     * @param response
+     * @return
+     */
+    @PreAuthorize ("hasAnyAuthority('sys:project:import')")
+    @GetMapping("import/template/consultation")
+    @ApiOperation(value = "下载模板")
+    public void importFileTemplateConsultation(HttpServletResponse response) {
+        String fileName = "项目数据导入模板.xlsx";
+        List<UserProjectDTO> list = Lists.newArrayList();
+        EasyPoiUtil.exportExcel ( list, "2021年资产评估项目备查登记表",  "咨询报告", UserProjectDTO.class, fileName, response );
+    }
+
 }

+ 43 - 1
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/domain/UserProject.java

@@ -1,6 +1,6 @@
 package com.jeeplus.sys.domain;
 
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.*;
 import com.jeeplus.core.domain.BaseEntity;
 import com.jeeplus.core.query.Query;
 import lombok.Data;
@@ -18,6 +18,43 @@ import java.util.Date;
 public class UserProject extends BaseEntity {
 
     /**
+     * 实体主键
+     */
+    @TableId
+    private String id;
+
+    /**
+     * 创建日期
+     */
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+
+    /**
+     * 创建人
+     */
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+    /**
+     * 更新日期
+     */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateDate;
+
+    /**
+     * 更新人
+     */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateBy;
+
+    /**
+     * 逻辑删除标记
+     */
+    @TableLogic
+    @TableField(fill = FieldFill.INSERT)
+    private Integer delFlag;
+
+    /**
      * 备注信息
      */
     private String remarks;
@@ -199,5 +236,10 @@ public class UserProject extends BaseEntity {
      */
     private String isCommissionReimbursement;
 
+    /**
+     * 1、评估项目 2、咨询项目
+     */
+    private String itemType;
+
     private static final long serialVersionUID = 1L;
 }

+ 2 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/UserMapper.java

@@ -35,6 +35,8 @@ public interface UserMapper extends BaseMapper<User> {
     @InterceptorIgnore(dataPermission = "true")
     UserDTO get(@Param(Constants.WRAPPER) QueryWrapper queryWrapper);
 
+    String getUserIdByLogin(@Param("loginName") String loginName);
+
     /**
      * 获取用户列表
      *

+ 10 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/UserProjectMapper.java

@@ -2,7 +2,17 @@ package com.jeeplus.sys.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.jeeplus.sys.domain.UserProject;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
+import java.util.ArrayList;
+
+@Mapper
 public interface UserProjectMapper extends BaseMapper<UserProject> {
+
+    public UserProject selectByDocumentNum(@Param("documentNum") String documentNum);
+
+    public IPage<UserProject> selectPage(UserProject userProject);
 }

+ 4 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/xml/UserMapper.xml

@@ -90,6 +90,10 @@
 		${ew.customSqlSegment}
 	</select>
 
+	<select id="getUserIdByLogin" resultType="string">
+		select id from sys_user where login_name = #{loginName}
+	</select>
+
 
 	<!-- 分页查询用户信息 -->
 	<select id="findList" resultMap="userResult">

+ 37 - 8
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/xml/UserProjectMapper.xml

@@ -40,18 +40,47 @@
     <result column="evaluation_person_one" jdbcType="VARCHAR" property="evaluationPersonOne" />
     <result column="evaluation_person_two" jdbcType="VARCHAR" property="evaluationPersonTwo" />
     <result column="status" jdbcType="VARCHAR" property="status" />
+    <result column="assess_report_message" jdbcType="VARCHAR" property="assessReportMessage" />
+    <result column="assess_base_message" jdbcType="VARCHAR" property="assessBaseMessage" />
+    <result column="invoice_message" jdbcType="VARCHAR" property="invoiceMessage" />
+    <result column="is_commission_reimbursement" jdbcType="VARCHAR" property="isCommissionReimbursement" />
+    <result column="item_type" jdbcType="VARCHAR" property="itemType" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, create_by, create_date, update_by, update_date, remarks, del_flag, customer_name, 
-    project_name, evaluation_objective, project_type, evaluation_base_date, evaluation_report_date, 
-    protocol_num, document_num, project_head, wayst_evaluation, fixed_assets_evaluation, 
-    net_assets_evaluation, rent_evaluation, forensics, report_charges, current_dispose_person, 
-    is_invoice, invoice_date, actual_charges, is_contract_archive, is_papers_intact, 
-    is_papers_archive, ops_amount, is_ops_reimbursement, reimbursement_amount, unreimbursed_amount, 
-    reimbursement_num, reimbursement_date, evaluation_person_one, evaluation_person_two, 
-    `status`
+    id, create_by, create_date, update_by, update_date, remarks, del_flag, customer_name,
+    project_name, evaluation_objective, project_type, evaluation_base_date, evaluation_report_date,
+    protocol_num, document_num, project_head, wayst_evaluation, fixed_assets_evaluation,
+    net_assets_evaluation, rent_evaluation, forensics, report_charges, current_dispose_person,
+    is_invoice, invoice_date, actual_charges, is_contract_archive, is_papers_intact,
+    is_papers_archive, ops_amount, is_ops_reimbursement, reimbursement_amount, unreimbursed_amount,
+    reimbursement_num, reimbursement_date, evaluation_person_one, evaluation_person_two,
+    `status`, assess_report_message, assess_base_message, invoice_message, is_commission_reimbursement,
+    item_type
   </sql>
 
 
+  <select id="selectByDocumentNum" resultType="com.jeeplus.sys.domain.UserProject">
+    select
+    <include refid="Base_Column_List"></include>
+    from
+    sys_user_project
+    where document_num = #{documentNum}
+  </select>
+
+  <select id="selectPage" resultType="com.jeeplus.sys.domain.UserProject">
+    select
+    <include refid="Base_Column_List"></include>
+    from
+    sys_user_project
+    <where >
+      <if test="userProject.customerName != null and userProject.customerName != ''">
+        customer_name like concat('%',#{userProject.customerName},'%')
+      </if>
+      <if test="userProject.projectName != null and userProject.projectName != ''">
+        project_name like concat('%',#{userProject.projectName},'%')
+      </if>
+    </where>
+
+  </select>
 
 </mapper>

+ 14 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/UserProjectService.java

@@ -2,21 +2,31 @@ package com.jeeplus.sys.service;
 
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jeeplus.sys.domain.UserProject;
 import com.jeeplus.sys.mapper.UserProjectMapper;
 import com.jeeplus.sys.service.dto.UserProjectDTO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.UUID;
 
 @Service
 @Transactional
 public class UserProjectService extends ServiceImpl<UserProjectMapper, UserProject> {
 
+    @Autowired
+    private UserProjectMapper userProjectMapper;
+
+    public IPage<UserProject> selectPage(UserProject userProject){
+        return userProjectMapper.selectPage(userProject);
+    }
+
     public UserProject projectDtoToDate(UserProject project, UserProjectDTO projectDTO){
         SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
         try {
@@ -58,4 +68,8 @@ public class UserProjectService extends ServiceImpl<UserProjectMapper, UserProje
 
         return wrapper;
     }
+
+    public UserProject selectByDocumentNum(String documentNum){
+        return userProjectMapper.selectByDocumentNum(documentNum);
+    }
 }

+ 7 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/UserService.java

@@ -47,6 +47,9 @@ public class UserService  extends ServiceImpl<UserMapper, User> {
 	@Autowired
 	private SysConfigService sysConfigService;
 
+	@Autowired
+	private UserMapper userMapper;
+
 	/**
 	 * 单一登录判断,是否允许登录
 	 * @return
@@ -94,6 +97,10 @@ public class UserService  extends ServiceImpl<UserMapper, User> {
 		return baseMapper.get (queryWrapper);
 	}
 
+	public String getUserIdByLogin(String loginName) {
+		return userMapper.getUserIdByLogin (loginName);
+	}
+
 
 	/**
 	 * 自定义分页检索

+ 11 - 8
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/dto/UserProjectDTO.java

@@ -16,7 +16,6 @@ public class UserProjectDTO extends BaseDTO {
     /**
      * 备注信息
      */
-    @ExcelIgnore
     private String remarks;
 
     /**
@@ -88,13 +87,13 @@ public class UserProjectDTO extends BaseDTO {
     /**
      * 废旧物资评估(万元)
      */
-    @Excel(name = "废旧物资评估(万元)")
+    @Excel(name = "废旧物资评估(万元)")
     private String waystEvaluation;
 
     /**
      * 固定资产评估(万元)
      */
-    @Excel(name = "固定资产评估(万元)")
+    @Excel(name = "固定资产评估(万元)")
     private String fixedAssetsEvaluation;
 
     /**
@@ -106,7 +105,7 @@ public class UserProjectDTO extends BaseDTO {
     /**
      * 租金评估(万/年)
      */
-    @Excel(name = "租金评估(万/年)")
+    @Excel(name = "租金评估(万/年)")
     private String rentEvaluation;
 
     /**
@@ -118,7 +117,7 @@ public class UserProjectDTO extends BaseDTO {
     /**
      * 报告收费(元)
      */
-    @Excel(name = "报告收费(元)")
+    @Excel(name = "报告收费(元)")
     private String reportCharges;
 
     /**
@@ -146,9 +145,9 @@ public class UserProjectDTO extends BaseDTO {
 
 
     /**
-     * 预估/实际收费(元)
+     * 预估/实际收费(元)
      */
-    @Excel(name = "客户名称")
+    @Excel(name = "预估/实际收费(万元)")
     private String actualCharges;
 
     /**
@@ -226,7 +225,6 @@ public class UserProjectDTO extends BaseDTO {
     /**
      * 项目状态
      */
-    @Excel(name = "项目状态")
     private String status;
 
     /**
@@ -250,6 +248,11 @@ public class UserProjectDTO extends BaseDTO {
     @Excel(name = "是否已经报销提成")
     private String isCommissionReimbursement;
 
+    /**
+     * 1、评估项目 2、咨询项目
+     */
+    private String itemType;
+
     private static final long serialVersionUID = 1L;
 
     public UserProjectDTO(){