浏览代码

全过程部分代码上传

user5 2 年之前
父节点
当前提交
2c1530b71d

+ 10 - 1
src/main/java/com/jeeplus/modules/projectConstruction/service/ContractService.java

@@ -7,6 +7,7 @@ import com.jeeplus.common.config.Global;
 import com.jeeplus.common.oss.OSSClientUtil;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.common.utils.SpringContextHolder;
 import com.jeeplus.modules.projectConstruction.dao.ContractDao;
 import com.jeeplus.modules.projectConstruction.entity.ConstructionContract;
@@ -80,7 +81,15 @@ public class ContractService extends CrudService<ContractDao,ConstructionContrac
      * @param
      * @return
      */
-    public Page<ConstructionContract> findPage(Page<ConstructionContract> page, ConstructionContract constructionContract) {
+    public Page<ConstructionContract> findPage(Page<ConstructionContract> page, ConstructionContract constructionContract) {//设置数据权限
+        if(!UserUtils.getUser().isAdmin()) {
+            String dataScopeSql = dataScopeFilterOR(constructionContract.getCurrentUser(), "o", "u", "s", MenuStatusEnum.WORK_RECORDS.getValue());
+            //判断是否为空,为空则进行新的权限查询
+            if(org.apache.commons.lang3.StringUtils.isBlank(dataScopeSql)){
+                dataScopeSql = dataScopeFilterOR(constructionContract.getCurrentUser(), "o", "u", "s", MenuStatusEnum.OVERALL_WORK_RECORDS.getValue());
+            }
+            constructionContract.getSqlMap().put("dsf", dataScopeSql);
+        }
         //根据项目类型获取对应的客户id个数
         int count = contractDao.queryCount(constructionContract);
         page.setCount(count);

+ 44 - 0
src/main/java/com/jeeplus/modules/projectType/service/ProjectTypeService.java

@@ -153,9 +153,53 @@ public class ProjectTypeService extends CrudService<ProjectTypeDao, ProjectType>
      * 根据typeId获取数据
      */
     public ProjectType getDataByTypeId(String typeId) {
+        typeId = getStageId(typeId);
         return projectTypeDao.getDataByTypeId(typeId);
     }
 
+
+    /**
+     * 根据类型生成对应编号
+     * @param stageType
+     * @return
+     */
+    public String getStageId(String stageType){
+        String stageId = "";
+        switch (stageType){
+            case "(隐蔽工程量)" :
+                stageId = "410";
+                break;
+            case "(甲供物资)" :
+                stageId = "411";
+                break;
+            case "(分部结算)" :
+                stageId = "412";
+                break;
+            case "(工程进度款)" :
+                stageId = "420";
+                break;
+            case "(暂定材料价)" :
+                stageId = "421";
+                break;
+            case "(设计变更)" :
+                stageId = "43";
+                break;
+            case "(现场签证)" :
+                stageId = "45";
+                break;
+            case "(索赔审核)" :
+                stageId = "46";
+                break;
+            default:
+                stageId = stageType;
+                break;
+
+        }
+
+        return stageId;
+    }
+
+
     /**
      * 查询依据性文件信息
      * @param typeId

+ 2 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/dao/ProjectcontentinfoDao.java

@@ -148,4 +148,6 @@ public interface ProjectcontentinfoDao extends CrudDao<Projectcontentinfo> {
 	 */
 	Integer insertContentAchievementInfo(@Param("contentId") String contentId, @Param("achievementId") String achievementId);
 
+	void deleteOverallProcessContentById(String id);
+
 }

+ 5 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectcontentinfoService.java

@@ -1731,4 +1731,9 @@ public class ProjectcontentinfoService extends CrudService<ProjectcontentinfoDao
 			dao.insertContentAchievementInfo(contentId,basedId);
 		}
 	}
+
+	@Transactional(readOnly = false)
+	public void deleteOverallProcessContentById(String id) {
+		dao.deleteOverallProcessContentById(id);
+	}
 }

+ 19 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/web/ProjectcontentinfoController.java

@@ -2235,4 +2235,23 @@ public class ProjectcontentinfoController extends BaseController {
 		return map;
 	}
 
+	/**
+	 * 删除依据性资料
+	 */
+	@RequestMapping(value = "deleteOverallProcessContentById")
+	@ResponseBody
+	public Map<String,Object> deleteOverallProcessContentById( Projectcontentinfo projectcontentinfo, RedirectAttributes redirectAttributes) {
+		Map<String,Object> j= new HashMap<>();
+		try {
+			projectcontentinfoService.deleteOverallProcessContentById(projectcontentinfo.getInfoId());
+			j.put("success",true);
+			j.put("msg","删除成功");
+		}catch (Exception e){
+			j.put("success",false);
+			j.put("msg","删除失败");
+			addMessage(redirectAttributes, "删除失败");
+		}
+		return j;
+	}
+
 }

+ 2 - 0
src/main/java/com/jeeplus/modules/projectreportnum/dao/ProjectReportNumDao.java

@@ -22,6 +22,8 @@ public interface ProjectReportNumDao extends CrudDao<ReportNum> {
     void updateNum(String num);
     ReportNum getLastReportNum(ReportNum reportNum);
 
+    ReportNum getNewLastReportNum(@Param("oldNum")String oldNum, @Param("newNum")String newNum);
+
     List<ProjectContentTreeData>  getReportNumList(ReportNum reportNum);
 
 

+ 106 - 13
src/main/java/com/jeeplus/modules/projectreportnum/service/ProjectReportNumService.java

@@ -105,31 +105,123 @@ public class ProjectReportNumService extends CrudService<ProjectReportNumDao, Re
 		/*if(count>=10){
 			return "最多领取10个报告号";
 		}*/
-		reportNum.setNum(reportNum.getNum()+"-"+reportNum.getStageId()+"-");
+		//设置老数据编号类型
+		String oldNum = reportNum.getNum() + "-" + reportNum.getStageId() + "-";
+		reportNum.setNum(reportNum.getNum()+getStageType(reportNum.getStageId()));
 		reportNum.setCreateBy(UserUtils.getUser());
 		//获取最后一个报告号数据信息
-		ReportNum lastReportNum = projectReportNumDao.getLastReportNum(reportNum);
+		ReportNum lastReportNum = projectReportNumDao.getNewLastReportNum(oldNum,reportNum.getNum());
 		if (null != lastReportNum){
 			lastReportNum.getNum().lastIndexOf("-");
-			//截取最后四位流水号
-			String substring = lastReportNum.getNum().substring(lastReportNum.getNum().lastIndexOf("-")+1, lastReportNum.getNum().length());
+			String substring = "";
+			if(lastReportNum.getNum().contains(")")){
+				substring = lastReportNum.getNum().substring(lastReportNum.getNum().lastIndexOf(")")+1, lastReportNum.getNum().length());
+			}else{
+				//截取最后四位流水号
+				substring = lastReportNum.getNum().substring(lastReportNum.getNum().lastIndexOf("-")+1, lastReportNum.getNum().length());
+			}
 			//转换为数字并递增
 			Integer substringInteger = Integer.parseInt(substring)+1;
 			//生成新的流水号
 			StringBuffer newSerialNum = new StringBuffer();
-			for(int x = 0; x < (4 - substringInteger.toString().length()); x++) {
+			for(int x = 0; x < (3 - substringInteger.toString().length()); x++) {
 				newSerialNum.append("0");
 			}
 			newSerialNum.append(substringInteger);
 			reportNum.setNum(reportNum.getNum()+newSerialNum);
 		}else{
-			reportNum.setNum(reportNum.getNum()+"0001");
+			reportNum.setNum(reportNum.getNum()+"001");
 		}
 		reportNum.setState("0");
 		super.save(reportNum);
 		return "领取成功";
 	}
 
+	/**
+	 * 根据类型生成对应编号
+	 * @param stageId
+	 * @return
+	 */
+	public String getStageType(String stageId){
+		String stageType = "";
+		switch (stageId){
+			case "410" :
+				stageType = "(隐蔽工程量)";
+				break;
+			case "411" :
+				stageType = "(甲供物资)";
+				break;
+			case "412" :
+				stageType = "(分部结算)";
+				break;
+			case "420" :
+				stageType = "(工程进度款)";
+				break;
+			case "421" :
+				stageType = "(暂定材料价)";
+				break;
+			case "43" :
+				stageType = "(设计变更)";
+				break;
+			case "45" :
+				stageType = "(现场签证)";
+				break;
+			case "46" :
+				stageType = "(索赔审核)";
+				break;
+			default:
+				stageType = stageId;
+				break;
+
+		}
+
+		return stageType;
+	}
+
+
+
+
+	/**
+	 * 根据类型生成对应编号
+	 * @param stageType
+	 * @return
+	 */
+	public String getStageId(String stageType){
+		String stageId = "";
+		switch (stageType){
+			case "(隐蔽工程量)" :
+				stageId = "410";
+				break;
+			case "(甲供物资)" :
+				stageId = "411";
+				break;
+			case "(分部结算)" :
+				stageId = "412";
+				break;
+			case "(工程进度款)" :
+				stageId = "420";
+				break;
+			case "(暂定材料价)" :
+				stageId = "421";
+				break;
+			case "(设计变更)" :
+				stageId = "43";
+				break;
+			case "(现场签证)" :
+				stageId = "45";
+				break;
+			case "(索赔审核)" :
+				stageId = "46";
+				break;
+			default:
+				stageId = stageType;
+				break;
+
+		}
+
+		return stageId;
+	}
+
 
 	public List<ProjectContentTreeData> getReportNumList(ReportNum reportNum) {
 		return projectReportNumDao.getReportNumList(reportNum);
@@ -150,14 +242,15 @@ public class ProjectReportNumService extends CrudService<ProjectReportNumDao, Re
 	 * @return
 	 */
 	public WorkContentType getWorkContentTypeByReportNum(String reportNumStr){
-		String regex="-(.*?)-";
-		Pattern p= Pattern.compile(regex);
-		Matcher m=p.matcher(reportNumStr);
-		while(m.find()){
-			WorkContentType contentType = projectReportNumDao.getWorkContentTypeByReportNum(m.group(1));
-			return contentType;
+		String group = "";
+		if(reportNumStr.contains("(")){
+			group = reportNumStr.substring(reportNumStr.indexOf("("),reportNumStr.indexOf(")")+1);
+		}else{
+			group = reportNumStr.split("-")[1];
 		}
-		return null;
+		group = getStageId(group);
+		WorkContentType contentType = projectReportNumDao.getWorkContentTypeByReportNum(group);
+		return contentType;
 	}
 	//通过id获取阶段名称
 	public String getStageName(String reportType) {

+ 22 - 6
src/main/java/com/jeeplus/modules/projectreportnum/web/ProjectReportNumController.java

@@ -127,7 +127,12 @@ public class ProjectReportNumController extends BaseController {
 				pct.setStageName(stageName);
 				//判定如果不是父节点 则查询工作内容名称并展示
 				if (!"0".equals(pct.getPid())){
-					String typeId = pct.getNum().split("-")[1];
+					String typeId = "";
+					if(pct.getNum().contains("(")){
+						typeId = pct.getNum().substring(pct.getNum().indexOf("("),pct.getNum().indexOf(")")+1);
+					}else{
+						typeId = pct.getNum().split("-")[1];
+					}
 					ProjectType dataByType = projectTypeService.getDataByTypeId(typeId);
 					pct.setTypeName(dataByType.getTypeName());
 				}else{
@@ -144,7 +149,12 @@ public class ProjectReportNumController extends BaseController {
 					listNum.add(treeData);
 				}else{
 					//截取字符串
-					String typeId=treeData.getNum().split("-")[1];
+					String typeId = "";
+					if(treeData.getNum().contains("(")){
+						typeId = treeData.getNum().substring(treeData.getNum().indexOf("("),treeData.getNum().indexOf(")")+1);
+					}else{
+						typeId = treeData.getNum().split("-")[1];
+					}
 					if(typeId.equals(projectTypeId)){
 						//根据父节点查询对应的附件信息
 						List<WorkClientAttachment> workClientAttachmentList = projectResultsFileTemplateService.getWorkClientAttachmentList(typeId);
@@ -176,18 +186,24 @@ public class ProjectReportNumController extends BaseController {
 					if(treeData.getPid().equals("0")){
 						listNum.add(treeData);
 					}else{
-						String typeId = treeData.getNum().split("-")[1];
+						String typeId = "";
+						if(treeData.getNum().contains("(")){
+							typeId = treeData.getNum().substring(treeData.getNum().indexOf("("),treeData.getNum().indexOf(")")+1);
+						}else{
+							typeId = treeData.getNum().split("-")[1];
+						}
+						String stageId = projectTypeService.getStageId(typeId);
 						//截取获取
 						//String typeStage=typeId.split("")[0];
 						//判断是否包含数据
-						if(typeIdList.contains(typeId)){
-							List<WorkClientAttachment> workClientAttachmentList = projectResultsFileTemplateService.getWorkClientAttachmentList(typeId);
+						if(typeIdList.contains(stageId)){
+							List<WorkClientAttachment> workClientAttachmentList = projectResultsFileTemplateService.getWorkClientAttachmentList(stageId);
 							if(null != workClientAttachmentList){
 								for (WorkClientAttachment workClientAttachment: workClientAttachmentList) {
 									treeData.setUrl(workClientAttachment.getUrl());
 								}
 								treeData.setCount(workClientAttachmentList.size());
-								treeData.setType(typeId);
+								treeData.setType(stageId);
 							}
 							listNum.add(treeData);
 						}

+ 67 - 17
src/main/resources/mappings/modules/constructionContract/contractDao.xml

@@ -35,6 +35,39 @@
 		a.end_date AS "endDate",
 		a.contract_name as "contractName"
 	</sql>
+	<sql id="newWorkContentContractinfoColumns">
+		cc.id AS "id",
+		cc.create_by AS "createBy.id",
+		cc.create_date AS "createDate",
+		cc.update_by AS "updateBy.id",
+		cc.update_date AS "updateDate",
+		cc.remarks AS "remarks",
+		cc.del_flag AS "delFlag",
+		cc.project_id AS "projectId",
+		cc.content_id AS "contentId",
+		cc.program_id AS "program.id",
+		cc.cnumber AS "cnumber",
+		cc.cont_cate AS "contCate",
+		cc.cont_attr AS "contAttr",
+		cc.letting_agent AS "lettingAgent",
+		cc.contractor AS "contractor",
+		cc.scope AS "scope",
+		cc.sign_date AS "signDate",
+		cc.effect_date AS "effectDate",
+		cc.titular_amt AS "titularAmt",
+		cc.true_amt AS "trueAmt",
+		cc.pledge_percent AS "pledgePercent",
+		cc.start_work_date AS "startWorkDate",
+		cc.end_work_date AS "endWorkDate",
+		cc.stop_percent AS "stopPercent",
+		cc.stop_amt AS "stopAmt",
+		cc.status AS "status",
+		cc.pay_type AS "payType",
+		cc.pay_amt AS "payAmt",
+		cc.start_date AS "startDate",
+		cc.end_date AS "endDate",
+		cc.contract_name as "contractName"
+	</sql>
 
 
 	<select id="get" resultType="com.jeeplus.modules.projectConstruction.entity.ConstructionContract" >
@@ -162,27 +195,35 @@
 
 	<select id="findList" resultType="com.jeeplus.modules.projectConstruction.entity.ConstructionContract" >
 		SELECT
-		pr.project_name as 'projectName',
+		DISTINCT a.project_name as 'projectName',
 		sd.label as 'contCate',
-		<include refid="workContentContractinfoColumns"/>
-		FROM construction_contract a
-		left join sys_dict sd on sd.value = a.cont_cate
-		left join project_records pr on pr.id = a.project_id
+		<include refid="newWorkContentContractinfoColumns"/>
+		FROM rural_project_records a
+		left join construction_contract cc on cc.project_id = a.id
+		left join sys_dict sd on sd.value = cc.cont_cate
+		LEFT JOIN work_project_user w1 ON a.id = w1.project_id
 		<where>
-			a.del_flag = 0
+			cc.del_flag = 0 AND a.project_type = '3' and a.status = 5
 			<if test="contractName != null and contractName !=''">
-				AND a.contract_name LIKE concat('%',#{contractName},'%')
+				AND cc.contract_name LIKE concat('%',#{contractName},'%')
+			</if>
+			<if test="projectName != null and projectName !=''">
+				AND a.project_name LIKE concat('%',#{projectName},'%')
+			</if>
+			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+				AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id} ))
 			</if>
 			<if test="cnumber != null and cnumber != ''">
-				AND a.cnumber like concat('%',#{cnumber},'%')
+				AND cc.cnumber like concat('%',#{cnumber},'%')
 			</if>
 			<if test="startDate !=null">
-				AND a.create_date >= #{startDate}
+				AND cc.create_date >= #{startDate}
 			</if>
 			<if test="endDate !=null">
-				AND a.create_date &lt; #{endDate}
+				AND cc.create_date &lt; #{endDate}
 			</if>
 		</where>
+		group by a.id
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -218,21 +259,30 @@
 
 	<select id="queryCount" resultType="int" >
 		SELECT
-		count(1)
-		FROM construction_contract a
+		DISTINCT count(DISTINCT a.id)
+		FROM rural_project_records a
+		left join construction_contract cc on cc.project_id = a.id
+		left join sys_dict sd on sd.value = cc.cont_cate
+		LEFT JOIN work_project_user w1 ON a.id = w1.project_id
 		<where>
-			a.del_flag = 0
+			a.del_flag = 0 AND a.project_type = '3' and a.status = 5
 			<if test="contractName != null and contractName !=''">
-				AND a.contract_name LIKE concat('%',#{contractName},'%')
+				AND cc.contract_name LIKE concat('%',#{contractName},'%')
+			</if>
+			<if test="projectName != null and projectName !=''">
+				AND a.project_name LIKE concat('%',#{projectName},'%')
+			</if>
+			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+				AND ((w1.user_id = #{currentUser.id} AND w1.del_flag='0' AND a.company_id = #{currentUser.company.id} ))
 			</if>
 			<if test="cnumber != null and cnumber != ''">
-				AND a.cnumber like concat('%',#{cnumber},'%')
+				AND cc.cnumber like concat('%',#{cnumber},'%')
 			</if>
 			<if test="startDate !=null">
-				AND a.create_date >= #{startDate}
+				AND cc.create_date >= #{startDate}
 			</if>
 			<if test="endDate !=null">
-				AND a.create_date &lt; #{endDate}
+				AND cc.create_date &lt; #{endDate}
 			</if>
 		</where>
 	</select>

+ 4 - 0
src/main/resources/mappings/modules/projectcontentinfo/ProjectcontentinfoDao.xml

@@ -649,4 +649,8 @@
 		where content_id = #{contentId}
 		and achievement_id = #{achievementId}
 	</select>
+
+	<update id="deleteOverallProcessContentById">
+		update project_content_data set del_flag = 1 where id = #{id}
+	</update>
 </mapper>

+ 13 - 1
src/main/resources/mappings/modules/projectreportnum/ProjectReportNumDao.xml

@@ -114,6 +114,17 @@
 		ORDER BY a.num desc limit 0,1
 	</select>
 
+	<select id="getNewLastReportNum" resultType="com.jeeplus.modules.projectreportnum.entity.ReportNum" >
+		SELECT
+		<include refid="infoColums"/>
+		FROM report_num a
+
+		<where>
+			a.num like concat('%',#{oldNum},'%') or a.num like concat('%',#{newNum},'%')
+		</where>
+		ORDER BY RIGHT(a.num,3) desc limit 0,1
+	</select>
+
 	<select id="getReportNumList" resultType="com.jeeplus.modules.projectcontentinfo.entity.ProjectContentTreeData" >
 		select
 		a.id as "id",
@@ -123,7 +134,8 @@
 		su.name as createId ,
 		a.create_date as "createDate"
 		from report_num a
-		left join sys_user su on su.id = a.create_by
+		left join rural_project_records rpr on a.project_id = rpr.id
+		left join sys_user su on su.id = rpr.create_by
 		<where>
 			a.del_flag = #{DEL_FLAG_NORMAL} and a.state = '0' and a.project_id = #{projectId}
 		</where>

+ 1 - 1
src/main/webapp/webpage/modules/projectrecord/check/checkInterimPayment.jsp

@@ -312,7 +312,7 @@
                 treeDefaultClose: true,//是否默认折叠
                 treeLinkage: true,//父级展开时是否自动展开所有子级
                 elem: '#permissionTable',
-                url: '${ctx}/project/checkInterimPayment/getProjectList?pageNo=${page.pageNo}&contractName='+contractName+'&projectName='+projectName,
+                url: '${ctx}/project/checkInterimPayment/getProjectList?pageNo=${page.pageNo}&pageSize=${page.pageSize}&contractName='+contractName+'&projectName='+projectName,
                 page: false,
 				cols: [[
 					{type: 'numbers', align:'center', title: '序号' ,width:80},

+ 23 - 0
src/main/webapp/webpage/modules/projectrecord/distributionSettlement/distributionSettlementList.jsp

@@ -342,6 +342,7 @@
                         return [
                             '<div class=\"layui-btn-group\">'+
                             '<a href="javascript:void(0)" onclick="openDialogreAudit(\'修改分布结算信息\', \'${ctx}/projectcontentinfo/projectcontentinfo/form?view=content&condition=distribution&flag=modify&dictType=${dictType}&infoId='+d.id+'&id='+d.contentPId+'&project.overallProjectTypeId='+$("#overallProjectTypeId").val()+'\',\'95%\',\'95%\')" class="layui-btn layui-btn-xs"" > 编辑</a>',
+                            '<a href="javascript:void(0)" onclick="confirmDelete(\'确认要删除该分布结算信息吗\', \'${ctx}/projectcontentinfo/projectcontentinfo/deleteOverallProcessContentById?infoId='+d.id+'\')" class="layui-btn layui-btn-xs layui-bg-red" > 删除</a>',
                             '<a href="javascript:void(0)" onclick="confirmxHintContent(\'提示内容\', \'${ctx}/projectType/projectType/getHintContent?id='+d.projectTypeId+'\',\'95%\',\'95%\')" class="fa fa-search-plus layui-bg-orange layui-btn layui-btn-xs" > 提示</a>',
                             +'</div>'
                         ].join('');
@@ -464,6 +465,28 @@
             }
         });
     }
+
+    function confirmDelete(mess, href){
+        top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
+            //do something
+            if (typeof href == 'function') {
+                href();
+            }else{
+                $.ajax({
+                    url:href,
+                    type:"post",
+                    success:function(data){
+                        if(data.success){
+                            top.layer.msg("删除成功!", {icon: 1});
+                            sortOrRefresh()
+                        }
+                    }
+                });
+            }
+            top.layer.close(index);
+        });
+        return false;
+    }
     // 确认对话框
     function confirmxRefresh(mess, href){
         top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){