Procházet zdrojové kódy

成本监审表模板管理

bj před 1 měsícem
rodič
revize
a043613811

+ 1 - 1
assistMg/src/main/java/com/hotent/project/dao/CostProjectMemoDao.java

@@ -34,5 +34,5 @@ public interface CostProjectMemoDao extends BaseMapper<CostProjectMemo> {
 
     List<CostProjectMemo> getDataMonth(@Param("dataScope") Integer dataScope, @Param("provinceCode") String provinceCode,@Param("cityCode") String cityCode, @Param("countyCode") String countyCode, @Param("memoDate") String memoDate);
 
-    List<CostProjectMemo> getIndexDataMonth(@Param("userId") String userId, @Param("month") String month);
+    List<CostProjectMemo> getIndexDataMonth(@Param("userId") String userId, @Param("memoDate") String memoDate);
 }

+ 13 - 1
assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectMemoManagerImpl.java

@@ -59,7 +59,7 @@ public class CostProjectMemoManagerImpl extends BaseManagerImpl<CostProjectMemoD
     	CostProjectMemo costProjectMemo = this.get(id);
 		CostProjectMemoDetailResp costProjectMemoDetailResp = CopyUtil.copy(costProjectMemo, CostProjectMemoDetailResp.class);
 		//获取成本项目
-		 CostProjectApproval  CostProjectApproval = costProjectApprovalDao.selectById(costProjectMemo.getProjectId());
+		CostProjectApproval  CostProjectApproval = costProjectApprovalDao.selectById(costProjectMemo.getProjectId());
 		if ( CostProjectApproval != null){
 			costProjectMemoDetailResp.setTask( CostProjectApproval.getProjectName());
 		}else {
@@ -264,6 +264,12 @@ public class CostProjectMemoManagerImpl extends BaseManagerImpl<CostProjectMemoD
 		if (costProjectMemos != null && costProjectMemos.size() > 0) {
 			//填充到planNameMap中,key为日期,value为项目、
 			for (CostProjectMemo costProjectMemo : costProjectMemos) {
+				CostProjectApproval  CostProjectApproval = costProjectApprovalDao.selectById(costProjectMemo.getProjectId());
+				if ( CostProjectApproval != null){
+					costProjectMemo.setTask( CostProjectApproval.getProjectName());
+				}else {
+					costProjectMemo.setTask("");
+				}
 				if(planNameMap.containsKey(costProjectMemo.getMemoDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))){
 					planNameMap.get(costProjectMemo.getMemoDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))).add(costProjectMemo);
 				}else{
@@ -287,6 +293,12 @@ public class CostProjectMemoManagerImpl extends BaseManagerImpl<CostProjectMemoD
 		if (costProjectMemos != null && costProjectMemos.size() > 0) {
 			//填充到planNameMap中,key为日期,value为项目、
 			for (CostProjectMemo costProjectMemo : costProjectMemos) {
+				CostProjectApproval  CostProjectApproval = costProjectApprovalDao.selectById(costProjectMemo.getProjectId());
+				if ( CostProjectApproval != null){
+					costProjectMemo.setTask( CostProjectApproval.getProjectName());
+				}else {
+					costProjectMemo.setTask("");
+				}
 				if(planNameMap.containsKey(costProjectMemo.getMemoDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))){
 					planNameMap.get(costProjectMemo.getMemoDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))).add(costProjectMemo);
 				}else{

+ 16 - 3
assistMg/src/main/java/com/hotent/surveyinfo/controller/CostSurveyFdTemplateController.java

@@ -19,6 +19,7 @@ import com.hotent.surveyinfo.req.ConstSurveyFdPageParam;
 import com.hotent.surveyinfo.req.ConstSurveyFdPageReq;
 import com.hotent.surveyinfo.req.ConstSurveyPageReq;
 import com.hotent.uc.api.model.IUser;
+import com.hotent.uc.model.User;
 import com.hotent.uc.util.ContextUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -97,7 +98,7 @@ public class CostSurveyFdTemplateController extends BaseController<CostSurveyFdT
 	 * 根据id获取财务数据表模板表数据详情
 	 * @param id
 	 * @return
-	 * @throws Exception 
+	 * @throws Exception
 	 * ModelAndView
 	 */
 
@@ -109,9 +110,9 @@ public class CostSurveyFdTemplateController extends BaseController<CostSurveyFdT
     /**
 	 * 新增,更新财务数据表模板表
 	 * @param costSurveyTemplate
-	 * @throws Exception 
+	 * @throws Exception
 	 * @return
-	 * @exception 
+	 * @exception
 	 */
 	@PostMapping(value="/save")
 	@ApiOperation(value = "新增,更新财务数据表模板表数据", httpMethod = "POST", notes = "新增,更新财务数据表模板表数据")
@@ -129,6 +130,18 @@ public class CostSurveyFdTemplateController extends BaseController<CostSurveyFdT
 			costSurveyTemplate.setUpdateBy(ContextUtil.getCurrentUser().getAccount());
 			costSurveyTemplate.setUpdateTime(LocalDateTime.now());
 		}
+		User currentUser = ContextUtil.getCurrentUser();
+		Integer dataScope = currentUser.getDataScope();
+		if (dataScope == 0) {
+			costSurveyTemplate.setAreaLevel("0");
+			costSurveyTemplate.setAreaCode(currentUser.getProvinceCode());
+		} else if (dataScope == 1){
+			costSurveyTemplate.setAreaLevel("1");
+			costSurveyTemplate.setAreaCode(currentUser.getCityCode());
+		}else{
+			costSurveyTemplate.setAreaLevel("2");
+			costSurveyTemplate.setAreaCode(currentUser.getCountyCode());
+		}
 		baseService.createOrUpdate(costSurveyTemplate);
 		return CommonResult.<String>ok().message(msg);
 	}

+ 13 - 0
assistMg/src/main/java/com/hotent/surveyinfo/controller/CostSurveyTemplateController.java

@@ -16,6 +16,7 @@ import com.hotent.surveyinfo.model.*;
 import com.hotent.surveyinfo.req.ConstSurveyPageParam;
 import com.hotent.surveyinfo.req.ConstSurveyPageReq;
 import com.hotent.uc.api.model.IUser;
+import com.hotent.uc.model.User;
 import com.hotent.uc.util.ContextUtil;
 import io.swagger.annotations.Api;
 import org.apache.poi.ss.usermodel.Cell;
@@ -125,6 +126,18 @@ public class CostSurveyTemplateController extends BaseController<CostSurveyTempl
     @ApiOperation(value = "新增,更新成本调查表模板表数据", httpMethod = "POST", notes = "新增,更新成本调查表模板表数据")
     public CommonResult<String> save(@ApiParam(name = "CostSurveyTemplate", value = "成本调查表模板表对象", required = true) @RequestBody CostSurveyTemplate costSurveyTemplate) throws Exception {
         String msg = StringUtil.isEmpty(costSurveyTemplate.getSurveyTemplateId()) ? "添加成本调查表模板表成功" : "更新成本调查表模板表成功";
+        User currentUser = ContextUtil.getCurrentUser();
+        Integer dataScope = currentUser.getDataScope();
+        if (dataScope == 0) {
+            costSurveyTemplate.setAreaLevel("0");
+            costSurveyTemplate.setAreaCode(currentUser.getProvinceCode());
+        } else if (dataScope == 1){
+            costSurveyTemplate.setAreaLevel("1");
+            costSurveyTemplate.setAreaCode(currentUser.getCityCode());
+        }else{
+            costSurveyTemplate.setAreaLevel("2");
+            costSurveyTemplate.setAreaCode(currentUser.getCountyCode());
+        }
         if (StringUtil.isEmpty(costSurveyTemplate.getSurveyTemplateId())) {
             IUser user = ContextUtil.getCurrentUser();
             costSurveyTemplate.setCreateBy(user.getAccount());

+ 16 - 4
assistMg/src/main/java/com/hotent/surveyinfo/controller/CostVerifyTemplateController.java

@@ -19,6 +19,7 @@ import com.hotent.surveyinfo.req.ConstSurveyPageReq;
 import com.hotent.surveyinfo.req.ConstVerifyPageParam;
 import com.hotent.surveyinfo.req.ConstVerifyPageReq;
 import com.hotent.uc.api.model.IUser;
+import com.hotent.uc.model.User;
 import com.hotent.uc.util.ContextUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -176,7 +177,7 @@ public class CostVerifyTemplateController extends BaseController<CostVerifyTempl
 	 * 根据id获取成本核定表模板表数据详情
 	 * @param id
 	 * @return
-	 * @throws Exception 
+	 * @throws Exception
 	 * ModelAndView
 	 */
 	@GetMapping(value="/getDetail")
@@ -187,9 +188,9 @@ public class CostVerifyTemplateController extends BaseController<CostVerifyTempl
     /**
 	 * 新增,更新成本核定表模板表
 	 * @param costSurveyTemplate
-	 * @throws Exception 
+	 * @throws Exception
 	 * @return
-	 * @exception 
+	 * @exception
 	 */
 	@PostMapping(value="/save")
 	@ApiOperation(value = "新增,更新成本核定表模板表数据", httpMethod = "POST", notes = "新增,更新成本核定表模板表数据")
@@ -205,7 +206,18 @@ public class CostVerifyTemplateController extends BaseController<CostVerifyTempl
 			costSurveyTemplate.setUpdateBy(ContextUtil.getCurrentUser().getAccount());
 			costSurveyTemplate.setUpdateTime(LocalDateTime.now());
 		}
-
+		User currentUser = ContextUtil.getCurrentUser();
+		Integer dataScope = currentUser.getDataScope();
+		if (dataScope == 0) {
+			costSurveyTemplate.setAreaLevel("0");
+			costSurveyTemplate.setAreaCode(currentUser.getProvinceCode());
+		} else if (dataScope == 1){
+			costSurveyTemplate.setAreaLevel("1");
+			costSurveyTemplate.setAreaCode(currentUser.getCityCode());
+		}else{
+			costSurveyTemplate.setAreaLevel("2");
+			costSurveyTemplate.setAreaCode(currentUser.getCountyCode());
+		}
 		baseService.createOrUpdate(costSurveyTemplate);
 		return CommonResult.<String>ok().message(msg);
 	}

+ 6 - 2
assistMg/src/main/resources/mapper/CostProjectMemoMapper.xml

@@ -159,7 +159,9 @@
         cpm.memo_date,
         cpm.title,
         cpm.content,
-        cpm.reminder_type
+        cpm.reminder_type,
+        cpm.time_period,
+        cpm.task
         from cost_project_memo cpm
         left join cost_project_approval cpa ON cpm.project_id = cpa.project_id
         <where>
@@ -187,7 +189,9 @@
         cpm.memo_date,
         cpm.title,
         cpm.content,
-        cpm.reminder_type
+        cpm.reminder_type,
+        cpm.time_period,
+        cpm.task
         FROM
         cost_project_memo cpm left join
         cost_project_approval cpa

+ 34 - 32
assistMg/src/main/resources/mapper/CostSurveyFdTemplateMapper.xml

@@ -69,29 +69,29 @@
 	</select>
 
 	<select id="selectPage" resultMap="BaseResultMap">
-		select 
-			<include refid="Base_Column_List"/> 
+		select
+			<include refid="Base_Column_List"/>
 		from
 		cost_survey_fd_template
 		${ew.customSqlSegment}
 	</select>
-	
+
 	<select id="selectList" resultMap="BaseResultMap">
-		select 
-			<include refid="Base_Column_List"/> 
+		select
+			<include refid="Base_Column_List"/>
 		from
 		cost_survey_fd_template
 		${ew.customSqlSegment}
 	</select>
 
 
-	
+
 	<select id="selectById" resultMap="BaseResultMap">
-		select 
-			<include refid="Base_Column_List"/> 
+		select
+			<include refid="Base_Column_List"/>
 		from
 		cost_survey_fd_template
-		where 
+		where
 		    survey_template_id = #{surveyTemplateId}
 	</select>
 
@@ -102,31 +102,33 @@
 		SELECT
 		c.*
 		FROM
-		cost_survey_fd_template c,
-		uc_user u
-		WHERE
-		c.create_by=u.ACCOUNT_
-		<if test=" contentType != null and  contentType != ''">
-			and c.content_type=#{ contentType}
-		</if>
-		<if test=" type != null and  type != ''">
-			and c.type=#{ type}
-		</if>
-
-		<if test=" keyword != null and  keyword != ''">
-			and c.survey_template_name LIKE CONCAT('%', #{ keyword}, '%')
-		</if>
-		<if test=" status != null and  status != ''">
-			and c.status=#{ status}
-		</if>
-		<if test=" dataScope != null and  dataScope != ''">
-			<if test=" dataScope ==1">
-				and (u.PROVINCE_CODE=#{ provinceCode} or u.CITY_CODE=#{ cityCode})
+		cost_survey_fd_template c
+		<where>
+			<if test=" contentType != null and  contentType != ''">
+				and c.content_type=#{ contentType}
+			</if>
+			<if test=" type != null and  type != ''">
+				and c.type=#{ type}
 			</if>
-			<if test=" dataScope ==2">
-				and (u.PROVINCE_CODE=#{ provinceCode} or u.CITY_CODE=#{ cityCode} or u.COUNTY_CODE=#{ countyCode})
+
+			<if test=" keyword != null and  keyword != ''">
+				and c.survey_template_name LIKE CONCAT('%', #{ keyword}, '%')
+			</if>
+			<if test=" status != null and  status != ''">
+				and c.status=#{ status}
 			</if>
-		</if>
+			<if test=" dataScope != null and  dataScope != ''">
+				<if test=" dataScope ==0">
+					and c.area_code= #{provinceCode}
+				</if>
+				<if test=" dataScope ==1">
+					and c.area_code=#{cityCode}
+				</if>
+				<if test=" dataScope ==2">
+					and c.area_code= #{countyCode}
+				</if>
+			</if>
+		</where>
 		ORDER BY c.create_time DESC
 	</select>
 

+ 38 - 36
assistMg/src/main/resources/mapper/CostSurveyTemplateMapper.xml

@@ -68,62 +68,64 @@
 	</select>
 
 	<select id="selectPage" resultMap="BaseResultMap">
-		select 
-			<include refid="Base_Column_List"/> 
+		select
+			<include refid="Base_Column_List"/>
 		from
 			cost_survey_template
 		${ew.customSqlSegment}
 	</select>
-	
+
 	<select id="selectList" resultMap="BaseResultMap">
-		select 
-			<include refid="Base_Column_List"/> 
+		select
+			<include refid="Base_Column_List"/>
 		from
 			cost_survey_template
 		${ew.customSqlSegment}
 	</select>
-	
+
 	<select id="selectById" resultMap="BaseResultMap">
-		select 
-			<include refid="Base_Column_List"/> 
+		select
+			<include refid="Base_Column_List"/>
 		from
 			cost_survey_template
-		where 
+		where
 		    survey_template_id = #{surveyTemplateId}
 	</select>
 
 	<select id="getCostSurveyTemplatePage1"
 			resultMap="BaseResultMap">
-		SELECT
-			c.*
-		FROM
-			cost_survey_template c,
-			uc_user u
-		WHERE
-			c.create_by=u.ACCOUNT_
-		<if test=" contentType != null and  contentType != ''">
-			and c.content_type=#{ contentType}
-		</if>
-		<if test=" type != null and  type != ''">
-			and c.type=#{ type}
-		</if>
+        SELECT
+        c.*
+        FROM
+        cost_survey_template c
+		<where>
+			<if test=" contentType != null and  contentType != ''">
+				and c.content_type=#{ contentType}
+			</if>
+			<if test=" type != null and  type != ''">
+				and c.type=#{ type}
+			</if>
 
-		<if test=" keyword != null and  keyword != ''">
-			and c.survey_template_name LIKE CONCAT('%', #{ keyword}, '%')
-		</if>
-		<if test=" status != null and  status != ''">
-			and c.status=#{ status}
-		</if>
-		<if test=" dataScope != null and  dataScope != ''">
-			<if test=" dataScope ==1">
-				and (u.PROVINCE_CODE=#{ provinceCode} or u.CITY_CODE=#{ cityCode})
+			<if test=" keyword != null and  keyword != ''">
+				and c.survey_template_name LIKE CONCAT('%', #{ keyword}, '%')
 			</if>
-			<if test=" dataScope ==2">
-				and (u.PROVINCE_CODE=#{ provinceCode} or u.CITY_CODE=#{ cityCode} or u.COUNTY_CODE=#{ countyCode})
+			<if test=" status != null and  status != ''">
+				and c.status=#{ status}
 			</if>
-		</if>
-		ORDER BY c.create_time DESC
-	</select>
+			<if test=" dataScope != null and  dataScope != ''">
+				<if test=" dataScope ==0">
+					and c.area_code= #{provinceCode}
+				</if>
+				<if test=" dataScope ==1">
+					and c.area_code=#{cityCode}
+				</if>
+				<if test=" dataScope ==2">
+					and c.area_code= #{countyCode}
+				</if>
+			</if>
+		</where>
+        ORDER BY c.create_time DESC
+    </select>
 
 
 </mapper>

+ 33 - 31
assistMg/src/main/resources/mapper/CostVerifyTemplateMapper.xml

@@ -69,27 +69,27 @@
 	</select>
 
 	<select id="selectPage" resultMap="BaseResultMap">
-		select 
-			<include refid="Base_Column_List"/> 
+		select
+			<include refid="Base_Column_List"/>
 		from
 		 cost_verify_template
 		${ew.customSqlSegment}
 	</select>
-	
+
 	<select id="selectList" resultMap="BaseResultMap">
-		select 
-			<include refid="Base_Column_List"/> 
+		select
+			<include refid="Base_Column_List"/>
 		from
 		   cost_verify_template
 		${ew.customSqlSegment}
 	</select>
-	
+
 	<select id="selectById" resultMap="BaseResultMap">
-		select 
-			<include refid="Base_Column_List"/> 
+		select
+			<include refid="Base_Column_List"/>
 		from
 		    cost_verify_template
-		where 
+		where
 		    survey_template_id = #{surveyTemplateId}
 	</select>
 
@@ -99,31 +99,33 @@
 		SELECT
 		c.*
 		FROM
-		cost_verify_template c,
-		uc_user u
-		WHERE
-		c.create_by=u.ACCOUNT_
-		<if test=" contentType != null and  contentType != ''">
-			and c.content_type=#{ contentType}
-		</if>
-		<if test=" type != null and  type != ''">
-			and c.type=#{ type}
-		</if>
+		cost_verify_template c
+		<where>
+			<if test=" contentType != null and  contentType != ''">
+				and c.content_type=#{ contentType}
+			</if>
+			<if test=" type != null and  type != ''">
+				and c.type=#{ type}
+			</if>
 
-		<if test=" keyword != null and  keyword != ''">
-			and c.survey_template_name LIKE CONCAT('%', #{ keyword}, '%')
-		</if>
-		<if test=" status != null and  status != ''">
-			and c.status=#{ status}
-		</if>
-		<if test=" dataScope != null and  dataScope != ''">
-			<if test=" dataScope ==1">
-				and (u.PROVINCE_CODE=#{ provinceCode} or u.CITY_CODE=#{ cityCode})
+			<if test=" keyword != null and  keyword != ''">
+				and c.survey_template_name LIKE CONCAT('%', #{ keyword}, '%')
+			</if>
+			<if test=" status != null and  status != ''">
+				and c.status=#{ status}
 			</if>
-			<if test=" dataScope ==2">
-				and (u.PROVINCE_CODE=#{ provinceCode} or u.CITY_CODE=#{ cityCode} or u.COUNTY_CODE=#{ countyCode})
+			<if test=" dataScope != null and  dataScope != ''">
+				<if test=" dataScope ==0">
+					and c.area_code= #{provinceCode}
+				</if>
+				<if test=" dataScope ==1">
+					and c.area_code=#{cityCode}
+				</if>
+				<if test=" dataScope ==2">
+					and c.area_code= #{countyCode}
+				</if>
 			</if>
-		</if>
+		</where>
 		ORDER BY c.create_time DESC
 	</select>