Ver código fonte

项目报告签发,报批签发调整

user5 5 meses atrás
pai
commit
54fc617631

+ 3 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/domain/JyProject.java

@@ -193,6 +193,9 @@ public class JyProject extends BaseEntity implements Serializable {
     private String contractTypeFirst;
     @TableField(exist = false)
     private String contractTypeFirstValue;
+    //用于判定用印中报告签发和报批签发的信息
+    @TableField(exist = false)
+    private String getType;
 
     /**
      * 联系人

+ 6 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/mapper/xml/ProjectListMapper.xml

@@ -427,7 +427,12 @@
             left join jy_project_outinstance po on a.id=po.project_id
             left join jy_project_members pm on a.id = pm.project_id
             left join jy_work_contract_info wci on wci.id = a.contract_id
-             where (pm.user_id = #{id} or a.create_by_id = #{id}) and a.status = '5'
+            left join jy_user_signet jus on jus.project_id like concat('%',a.id,'%')
+            left join jy_project_audit jpa on jpa.project_id = a.id
+            left join jy_project_outinstance jpo on jpo.project_id = a.id
+            ${ew.customSqlSegment}
+
+            and (pm.user_id = #{id} or a.create_by_id = #{id}) and a.status = '5'
             ORDER BY a.update_time DESC
     </select>
 

+ 14 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/project/service/JyProjectService.java

@@ -751,6 +751,7 @@ public class JyProjectService {
         //获取当前登录人信息
         UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken());
         QueryWrapper<JyProject> wrapper = QueryWrapperGenerator.buildQueryCondition(info, JyProject.class);
+        wrapper.eq("a.del_flag","0");
 //        wrapper.eq("a.create_by_id",userDTO.getId());
 //        wrapper.eq("pa3.status","5");
         //创建时间
@@ -765,6 +766,19 @@ public class JyProjectService {
         if (StringUtils.isNotBlank(info.getName())){
             wrapper.like("a.name",info.getName());
         }
+        if(StringUtils.isNotBlank(info.getGetType())){
+            if("1".equals(info.getGetType())){
+                wrapper.eq("jpa.audit_level","3");
+                wrapper.eq("jpa.status","5");
+                wrapper.eq("jpa.del_flag","0");
+                wrapper.apply("jus.project_id IS NULL OR (jus.type_status != '1' and jus.del_flag = 0)");
+
+            }else if("2".equals(info.getGetType())){
+                wrapper.eq("jpo.del_flag","0");
+                wrapper.eq("jpo.status","5");
+                wrapper.apply("jus.type_status != '2' and jus.del_flag = 0");
+            }
+        }
         IPage<JyProject> projectIPage=jyProjectMapper.getByCreate(userDTO.getId(),page,wrapper);
         return projectIPage;
     }

+ 13 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/controller/SignetController.java

@@ -22,6 +22,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 @RestController
@@ -145,6 +146,18 @@ public class SignetController {
     }
 
 
+    /**
+     * 根据id查询
+     * @param projectId
+     * @param typeStatus
+     * @return
+     */
+    @ApiOperation(value = "根据id查询")
+    @GetMapping(value = "/queryByProjectIdAndTypeStatus")
+    public ResponseEntity<Map<String, Object>> queryByProjectIdAndTypeStatus(@RequestParam String projectId, @RequestParam String typeStatus) {
+        Map<String, Object> map = signetService.queryByProjectIdAndTypeStatus(projectId, typeStatus);
+        return ResponseEntity.ok(map);
+    }
 
 
 

+ 13 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/mapper/SignetMapper.java

@@ -6,6 +6,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.business.project.domain.JyProjectAudit;
+import com.jeeplus.business.project.service.dto.JyProjectAuditDTO;
+import com.jeeplus.business.project.service.dto.JyProjectOutinstanceDTO;
 import com.jeeplus.business.useSeal.domain.Signet;
 import com.jeeplus.business.useSeal.service.dto.SignetDTO;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
@@ -39,4 +43,13 @@ public interface SignetMapper extends BaseMapper<Signet> {
     SignetDTO getByProjectId(@Param("projectId") String projectId);
 
     SignetDTO getByProjectIdAndTypeStatus(@Param("projectId") String projectId, @Param("typeStatus")Integer typeStatus);
+
+    SignetDTO queryByProjectIdAndTypeStatus(@Param("projectId") String projectId, @Param("typeStatus")String typeStatus);
+
+    JyProjectAuditDTO getThirdProjectAuditByProjectId(String projectId);
+
+
+    JyProjectOutinstanceDTO getProjectOutinstanceByProjectId(String projectId);
+
+
 }

+ 67 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/mapper/xml/SignetMapper.xml

@@ -200,5 +200,72 @@
                 and a.type_status = #{typeStatus}
                 and a.status in ('5')
     </select>
+    <select id="queryByProjectIdAndTypeStatus" resultType="com.jeeplus.business.useSeal.service.dto.SignetDTO">
+        select
+            a.id,
+            a.create_by_id,
+            a.update_by_id,
+            a.update_time,
+            a.approval_time,
+            su.name as createByName,
+            a.create_time as createDate,
+            a.project_id,
+            a.project_name,
+            a.no,
+            a.type,
+            a.first_type,
+            a.number,
+            a.status,
+            a.remarks,
+            a.proc_ins_id,
+            a.type_status,
+            a.process_definition_id,
+            so.name as office,
+            so.id,
+            art.ID_ as task_id
+            from  jy_user_signet a
+            left join sys_user su on a.create_by_id = su.id
+            left join sys_office so on su.office_id=so.id
+            left join act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
+            where (FIND_IN_SET(#{projectId},a.project_id) or a.project_id = #{projectId})
+                and a.type_status = #{typeStatus}
+    </select>
+
+    <select id="getThirdProjectAuditByProjectId" resultType="com.jeeplus.business.project.service.dto.JyProjectAuditDTO">
+        select
+        pa.id,
+        pa.create_by_id,
+        pa.create_time,
+        pa.update_by_id,
+        pa.update_time,
+        pa.del_flag,
+        pa.project_id,
+        pa.audit_level,
+        pa.audit_people,
+        pa.project_agree_time,
+        pa.initial_audit_opinion,
+        pa.initial_edit_opinion,
+        pa.edit_opinion,
+        pa.audit_opinion,
+        pa.proc_ins_id,
+        pa.process_definition_id,
+        pa.status,
+        pa.exceed_time_status,
+        pa.audit_agree_opinion
+        from jy_project_audit pa
+        where pa.del_flag = '0' and pa.project_id = #{projectId} and pa.audit_level = 3 and pa.status = 5
+    </select>
+
+    <select id="getProjectOutinstanceByProjectId" resultType="com.jeeplus.business.project.service.dto.JyProjectOutinstanceDTO">
+        select
+            id,
+            project_id,
+            status,
+            remarks,
+            proc_ins_id,
+            process_definition_id
+        from jy_project_outinstance
+        where project_id=#{projectId} and del_flag = 0 and status = 5
+    </select>
 
 </mapper>

+ 42 - 0
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/useSeal/service/SignetService.java

@@ -9,11 +9,14 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.business.project.domain.JyProject;
+import com.jeeplus.business.project.domain.JyProjectAudit;
 import com.jeeplus.business.project.domain.JyProjectOutinstance;
 import com.jeeplus.business.project.mapper.JyProjectMapper;
 import com.jeeplus.business.project.mapper.JyProjectOutinstanceMapper;
 import com.jeeplus.business.project.mapper.JyProjectReportsSubmitMapper;
 
+import com.jeeplus.business.project.service.dto.JyProjectAuditDTO;
+import com.jeeplus.business.project.service.dto.JyProjectOutinstanceDTO;
 import com.jeeplus.business.workContractInfo.mapper.JyWorkContractInfoMapper;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
@@ -552,4 +555,43 @@ public class SignetService {
         signetMapper.deleteById(id);
         return "删除成功";
     }
+
+
+    /**
+     * 根据id查询用印
+     * @param id
+     * @return
+     */
+    public Map<String,Object> queryByProjectIdAndTypeStatus(String projectId, String typeStatus) {
+        Map<String,Object> map = new HashMap<>();
+        map.put("success",false);
+        map.put("message","未查询到项目信息");
+
+        if(StringUtils.isNotBlank(projectId) && StringUtils.isNotBlank(typeStatus)){
+
+            SignetDTO dto = signetMapper.queryByProjectIdAndTypeStatus(projectId,typeStatus);
+            if(null == dto){
+                //根据typeStatus 查询三级校审或者外审流程状态,若是已完成,则可以申请,否则 不可以申请
+                if("1".equals(typeStatus)){//参数为1 则表示申请选择的是报告签发,需要判定该项目得三级校审审核完成
+                    //根据项目id查询
+                    JyProjectAuditDTO projectAudit = signetMapper.getThirdProjectAuditByProjectId(projectId);
+                    if(null != projectAudit){
+                        map.put("success",true);
+                        map.put("message","可进行报告签发");
+                    }
+                    return map;
+
+                }else if("2".equals(typeStatus)){//参数为2 则表示申请选择的是报批签发,需要判定该项目得外审审核完成
+                    //根据项目id查询外审信息
+                    JyProjectOutinstanceDTO outinstance = signetMapper.getProjectOutinstanceByProjectId(projectId);
+                    if(null != outinstance){
+                        map.put("success",true);
+                        map.put("message","可进行报批签发");
+                    }
+                    return map;
+                }
+            }
+        }
+        return  map;
+    }
 }

+ 2 - 1
jeeplus-modules/jeeplus-business/src/main/java/com/jeeplus/business/workContractInfo/mapper/xml/JyWorkContractInfoMapper.xml

@@ -4,7 +4,7 @@
 
 	<select id="findPageList" resultType="com.jeeplus.business.workContractInfo.domain.JyWorkContractInfo">
 		SELECT
-			a.id,
+			distinct (a.id),
 			a.create_by_id,
 			a.create_time,
 			a.update_by_id,
@@ -47,6 +47,7 @@
 			jy_work_contract_info a
 			LEFT JOIN sys_user c ON a.create_by_id = c.id
 			left join jy_work_client_info jy_ci on a.primary_linkman=jy_ci.name
+			LEFT JOIN jy_work_contract_inform_user jwciu ON a.id = jwciu.contract_id
 			left join act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
 		${ew.customSqlSegment}
 		ORDER BY a.update_time DESC