Browse Source

进度统计和服务对接权限限制

LuChongMei 6 giờ trước cách đây
mục cha
commit
b67a104079

+ 2 - 2
jp-console/jeeplus-module/ly/src/main/java/com/jeeplus/lyservice/controller/LyServiceController.java

@@ -61,8 +61,8 @@ public class LyServiceController {
 	public ResponseEntity<IPage<LyServiceDTO>> list(LyServiceDTO lyServiceDTO, Page<LyServiceDTO> page) throws Exception {
 		QueryWrapper queryWrapper = QueryWrapperGenerator.buildQueryCondition (lyServiceDTO, LyServiceDTO.class);
 		UserDTO userDTO = UserUtils.getCurrentUserDTO();
-		//		//挂钩干部(能看到对应企业)
-		if(userDTO.getRoleIds().equals("1910141956174053377")){
+		//挂钩干部(能看到对应企业)
+		if(userDTO.getRoleIds().equals("1915280292672946177")){
 			queryWrapper.eq ("qy.des13", userDTO.getLoginName() ); // 排除已经删除
 		}
 		IPage<LyServiceDTO> result = lyServiceService.findPage (page, queryWrapper);

+ 67 - 30
jp-console/jeeplus-module/ly/src/main/java/com/jeeplus/question/controller/DzfQuestionController.java

@@ -244,6 +244,7 @@ public class DzfQuestionController {
 	@ApiOperation(value = "获取进度统计数据")
 	@GetMapping("getProgressStatistics")
 	public ResponseEntity<HashMap<Object,String>> getProgressStatistics(String start, String end) {
+		HashMap<Object,String> result = new HashMap<>();
 		if (start.equals("")){
 			Calendar calendar = Calendar.getInstance();
 			int year = calendar.get(Calendar.YEAR);
@@ -252,35 +253,17 @@ public class DzfQuestionController {
 			end = year+"-"+ month + "-" + day;
 			start =year+"-"+month+"-01";
 		}
-		DzfQuestionDTO dzfQuestionDTO=new DzfQuestionDTO();
-		//		UserDTO userDTO = UserUtils.getCurrentUserDTO();
-//		//企业(能看到自己企业的问题)
-//		if(userDTO.getRoleIds().equals("38a14f1f42ed424eab4cb5d489596b0d")){
-//			EnterpriseInfoDTO ei=enterpriseInfoService.findByUserid ( userDTO.getLoginName());
-//			dzfQuestionDTO.setQyId(ei.getId());
-//		}
-//
-//		QueryWrapper queryWrapper = QueryWrapperGenerator.buildQueryCondition (dzfQuestionDTO, DzfQuestionDTO.class);
-//		//挂钩干部(能看到对应企业)
-//		if(userDTO.getRoleIds().equals("1910141956174053377")){
-//			queryWrapper.eq ("ei.bz6", userDTO.getLoginName() ); // 排除已经删除
-//		}
-//		//办公室(能看到所有提交的问题)
-//		if(userDTO.getRoleIds().equals("1910175386924417025")){
-//			queryWrapper.ne ("a.states", "0" ); // 排除已经删除
-//		}
-//		//办理部门
-//		if(userDTO.getRoleIds().equals("1910175949166673921")){
-//			queryWrapper.eq ("c.des3", userDTO.getLoginName() ); // 筛选流程中涉及到自己的
-//			IPage<DzfQuestionDTO> result = dzfQuestionService.findPage2 (page, queryWrapper);
-//			return ResponseEntity.ok (result);
-//		}else{
-//			IPage<DzfQuestionDTO> result = dzfQuestionService.findPage (page, queryWrapper);
-//			return ResponseEntity.ok (result);
-//		}
-		HashMap<Object,String> result = dzfQuestionService.getProgressStatistics(start,end);
+		UserDTO userDTO = UserUtils.getCurrentUserDTO();
+		//办理部门
+		if(userDTO.getRoleIds().equals("1910175949166673921")){
+			result = dzfQuestionService.getProgressStatistics2(start,end,userDTO.getLoginName());
+		}else{
+			result = dzfQuestionService.getProgressStatistics(start,end);
+		}
+
 		return ResponseEntity.ok ( result );
 	}
+
 	/**
 	 * 问题诉求列表数据
 	 */
@@ -288,7 +271,25 @@ public class DzfQuestionController {
 	@ApiOperation(value = "查询问题诉求列表数据")
 	@PreAuthorize("hasAuthority('question:dzfQuestion:list')")
 	@GetMapping("list2")
-	public ResponseEntity<IPage<DzfQuestionDTO>> list2(String state, Page<DzfQuestionDTO> page) throws Exception {
+	public ResponseEntity<IPage<DzfQuestionDTO>> list2(String start,String end,String state, Page<DzfQuestionDTO> page) throws Exception {
+
+		UserDTO userDTO = UserUtils.getCurrentUserDTO();
+		//办理部门
+		if(userDTO.getRoleIds().equals("1910175949166673921")){
+			IPage<DzfQuestionDTO> result = dzfQuestionService.findPage4 (page, state,start,end,userDTO.getLoginName());
+			return ResponseEntity.ok (result);
+		}else{
+			IPage<DzfQuestionDTO> result = dzfQuestionService.findPage3 (page, state,start,end);
+			return ResponseEntity.ok (result);
+		}
+	}
+
+	/**
+	 * 已办结统计
+	 */
+	@ApiLog("已办结统计")
+	@GetMapping("getReportFinishVisit")
+	public ResponseEntity<List<List<HashMap<String, Object>>>> getReportFinishVisit(String start, String end) throws Exception {
 
 //		UserDTO userDTO = UserUtils.getCurrentUserDTO();
 //		//企业(能看到自己企业的问题)
@@ -315,10 +316,46 @@ public class DzfQuestionController {
 //			IPage<DzfQuestionDTO> result = dzfQuestionService.findPage (page, queryWrapper);
 //			return ResponseEntity.ok (result);
 //		}
-		IPage<DzfQuestionDTO> result = dzfQuestionService.findPage3 (page, state);
-			return ResponseEntity.ok (result);
+		List<List<HashMap<String, Object>>> result = dzfQuestionService.getFinish (start, end);
+		return ResponseEntity.ok (result);
 	}
 
+	/**
+	 * 正在处理统计
+	 */
+//	@ApiLog("正在处理统计")
+//	@GetMapping("getReportContinueVisit")
+//	public ResponseEntity<List<List<HashMap<String, Object>>>> getReportContinueVisit(String start, String end) throws Exception {
+//
+////		UserDTO userDTO = UserUtils.getCurrentUserDTO();
+////		//企业(能看到自己企业的问题)
+////		if(userDTO.getRoleIds().equals("38a14f1f42ed424eab4cb5d489596b0d")){
+////			EnterpriseInfoDTO ei=enterpriseInfoService.findByUserid ( userDTO.getLoginName());
+////			dzfQuestionDTO.setQyId(ei.getId());
+////		}
+////
+////		QueryWrapper queryWrapper = QueryWrapperGenerator.buildQueryCondition (dzfQuestionDTO, DzfQuestionDTO.class);
+////		//挂钩干部(能看到对应企业)
+////		if(userDTO.getRoleIds().equals("1915280292672946177")){
+////			queryWrapper.eq ("ei.bz6", userDTO.getLoginName() ); // 排除已经删除
+////		}
+////		//办公室(能看到所有提交的问题)
+////		if(userDTO.getRoleIds().equals("1910175386924417025")){
+////			queryWrapper.ne ("a.states", "0" ); // 排除已经删除
+////		}
+////		//办理部门
+////		if(userDTO.getRoleIds().equals("1910175949166673921")){
+////			queryWrapper.eq ("c.des3", userDTO.getLoginName() ); // 筛选流程中涉及到自己的
+////			IPage<DzfQuestionDTO> result = dzfQuestionService.findPage2 (page, queryWrapper);
+////			return ResponseEntity.ok (result);
+////		}else{
+////			IPage<DzfQuestionDTO> result = dzfQuestionService.findPage (page, queryWrapper);
+////			return ResponseEntity.ok (result);
+////		}
+//		List<List<HashMap<String, Object>>> result = dzfQuestionService.getReportContinueVisit (start, end);
+//		return ResponseEntity.ok (result);
+//	}
+
 	/**
      * 导出问题诉求数据
      *

+ 11 - 1
jp-console/jeeplus-module/ly/src/main/java/com/jeeplus/question/mapper/DzfQuestionMapper.java

@@ -13,6 +13,7 @@ import com.jeeplus.question.service.dto.DzfQuestionDTO;
 import com.jeeplus.question.domain.DzfQuestion;
 
 import java.util.HashMap;
+import java.util.List;
 
 /**
  * 问题诉求MAPPER接口
@@ -41,5 +42,14 @@ public interface DzfQuestionMapper extends BaseMapper<DzfQuestion> {
 
     HashMap<Object, Object> getProgressYear(@Param("start")String start,@Param("end")String end);
 
-    IPage<DzfQuestionDTO> findList3(Page<DzfQuestionDTO> page, String state);
+    IPage<DzfQuestionDTO> findList3(Page<DzfQuestionDTO> page, String state,String start,String end);
+    IPage<DzfQuestionDTO> findList4(Page<DzfQuestionDTO> page, String state,String start,String end, String loginName);
+
+    List<HashMap<String, Object>> getFinishList(String start, String end);
+
+    HashMap<Object, Object> getProgressMonth2(String start, String end, String userName);
+
+    HashMap<Object, Object> getProgressYear2(String start, String end, String userName);
+
+
 }

+ 59 - 0
jp-console/jeeplus-module/ly/src/main/java/com/jeeplus/question/mapper/xml/DzfQuestionMapper.xml

@@ -83,6 +83,28 @@
 		AND DATE_FORMAT(create_date,'%Y') = DATE_FORMAT(#{end},'%Y');
 	</select>
 
+	<select id="getProgressMonth2" resultType="Map"  parameterType="String">
+		SELECT COUNT(*) allque, COUNT(IF(states != 0 or states IS NULL ,1,NULL )) AS unfinish
+		FROM
+		(SELECT record_id FROM dzf_question_op_record
+		WHERE del_flag = 0 AND FIND_IN_SET(#{userName},des3)
+		AND DATE_FORMAT(create_date, '%Y-%m-%d') >= #{start}  AND DATE_FORMAT(create_date, '%Y-%m-%d') &lt;= #{end}
+		GROUP BY record_id) b
+		LEFT JOIN dzf_question_detil a ON a.id = b.record_id
+		WHERE del_flag = 0;
+	</select>
+
+	<select id="getProgressYear2" resultType="Map" parameterType="String">
+		SELECT COUNT(*) allque, COUNT(IF(states = 0,1,NULL )) AS finish
+		FROM
+		(SELECT record_id FROM dzf_question_op_record
+		WHERE del_flag = 0 AND FIND_IN_SET(#{userName},des3)
+		AND DATE_FORMAT(create_date,'%Y') = DATE_FORMAT(#{end},'%Y')
+		GROUP BY record_id) b
+		LEFT JOIN dzf_question_detil a ON a.id = b.record_id
+		WHERE del_flag = 0;
+	</select>
+
 	<select id="findList3" resultType="com.jeeplus.question.service.dto.DzfQuestionDTO" >
 		SELECT
 		<include refid="dzfQuestionColumns"/>
@@ -95,7 +117,44 @@
 		<if test="state != 999">
 			AND b.states = #{state}
 		</if>
+		AND DATE_FORMAT(b.create_date, '%Y-%m-%d') >= #{start}  AND DATE_FORMAT(b.create_date, '%Y-%m-%d') &lt;= #{end}
 		group by a.id
 	</select>
 
+	<select id="findList4" resultType="com.jeeplus.question.service.dto.DzfQuestionDTO" >
+		SELECT
+		<include refid="dzfQuestionColumns"/>
+		FROM
+		(SELECT a.qid
+		FROM
+		(SELECT record_id FROM dzf_question_op_record
+		WHERE del_flag = 0 AND FIND_IN_SET(#{userName},des3)
+		AND DATE_FORMAT(create_date, '%Y-%m-%d') >= #{start}  AND DATE_FORMAT(create_date, '%Y-%m-%d') &lt;= #{end}
+		GROUP BY record_id) b
+		LEFT JOIN dzf_question_detil a ON a.id = b.record_id
+		WHERE del_flag = 0
+		<if test="state == 999">
+			AND (a.states != 0 OR a.states IS NULL)
+		</if>
+		<if test="state != 999">
+			AND a.states = #{state}
+		</if>
+		)b
+		LEFT JOIN dzf_question a ON b.qid = a.id
+		WHERE a.del_flag = 0 AND a.id IS NOT NULL;
+	</select>
+
+	<select id="getFinishList" resultType="Map">
+		SELECT a.*,c.qy_name,c.officer,c.qy_sd,b.q_type,DATE_FORMAT(b.create_date, '%Y-%m-%d') AS subtime,b.des FROM (
+		SELECT a.* FROM
+		(SELECT record_id,des6,op_type_name,DATE_FORMAT(create_date, '%Y-%m-%d') AS create_date,des2,des4 FROM dzf_question_op_record WHERE del_flag = 0
+		AND DATE_FORMAT(create_date, '%Y-%m-%d') >= #{start} AND DATE_FORMAT(create_date, '%Y-%m-%d') &lt;= #{end}
+		ORDER BY create_date DESC LIMIT 999999) a
+		GROUP BY  a.record_id) a
+		LEFT JOIN dzf_question_detil b ON a.record_id = b.id
+		LEFT JOIN dzf_question c ON b.qid = c.id
+		WHERE b.del_flag = 0 AND c.del_flag = 0 AND c.states IN (3,4)
+		ORDER BY q_type;
+	</select>
+
 </mapper>

+ 64 - 3
jp-console/jeeplus-module/ly/src/main/java/com/jeeplus/question/service/DzfQuestionService.java

@@ -20,7 +20,9 @@ import com.jeeplus.question.domain.DzfQuestionDetil;
 import com.jeeplus.question.mapper.DzfQuestionMapper;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 
 /**
  * 问题诉求Service
@@ -124,8 +126,67 @@ public class DzfQuestionService extends ServiceImpl<DzfQuestionMapper, DzfQuesti
 		allNum.put("finishAcount", String.valueOf(f2));
 		return allNum;
     }
+	public HashMap<Object, String> getProgressStatistics2(String start, String end, String userName) {
+		HashMap<Object, String> allNum = new HashMap<>();
+		// 月份
+		HashMap<Object, Object> monthNum = baseMapper.getProgressMonth2(start,end,userName);
+		// 计算占比
+		double unAcount =  0;
+		double unfinish = Double.valueOf(monthNum.get("unfinish").toString());
+		double monthallque = Double.valueOf(monthNum.get("allque").toString());
+		if(monthallque != 0){
+			unAcount = unfinish / monthallque * 100;
+		}
+		// 年份
+		HashMap<Object, Object> yearNum = baseMapper.getProgressYear2(start,end,userName);
+		// 计算占比
+		double finishAcount = 0 ;
+		double finish = Double.valueOf(yearNum.get("finish").toString());
+		double yearallque = Double.valueOf(yearNum.get("allque").toString());
+		if(yearallque!=0){
+			finishAcount = finish / yearallque * 100;
+		}
+		// 保存两位小数
+		BigDecimal bg = new BigDecimal(unAcount);
+		double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+		BigDecimal bg2 = new BigDecimal(finishAcount);
+		double f2 = bg2.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+		allNum.put("unfinish", String.valueOf(monthNum.get("unfinish")));
+		allNum.put("finish", String.valueOf(yearNum.get("finish")));
+		allNum.put("unAcount", String.valueOf(f1));
+		allNum.put("finishAcount", String.valueOf(f2));
+		return allNum;
+	}
+
+	public IPage<DzfQuestionDTO> findPage3(Page<DzfQuestionDTO> page, String state,String start,String end) {
+		return  baseMapper.findList3 (page, state,start,end);
+	}
 
-	public IPage<DzfQuestionDTO> findPage3(Page<DzfQuestionDTO> page, String state) {
-		return  baseMapper.findList3 (page, state);
+	public IPage<DzfQuestionDTO> findPage4(Page<DzfQuestionDTO> page, String state,String start,String end, String loginName) {
+		return  baseMapper.findList4 (page, state,start,end,loginName);
 	}
-}
+
+	public List<List<HashMap<String, Object>>> getFinish(String start, String end) {
+		// 获取已办结问题
+		List<List<HashMap<String, Object>>> allList = new ArrayList<>();
+		List<HashMap<String, Object>> finishList = baseMapper.getFinishList(start,end);
+		List<HashMap<String, Object>> itemList = new ArrayList<>();
+		for (int i = 0; i < finishList.size(); i++) {
+			itemList.add(finishList.get(i));
+			if(i == finishList.size() - 1){
+				allList.add(itemList);
+				break;
+			}
+			if(!finishList.get(i).get("q_type").equals(finishList.get(i+1).get("q_type"))){
+//				map.put(finishList.get(i).get("q_type").toString(),itemList);
+				allList.add(itemList);
+				itemList = new ArrayList<>();
+			}
+
+		}
+		return allList;
+	}
+
+
+
+}

+ 7 - 1
jp-mobile/pages/progress/ProgressQuestionList.vue

@@ -82,6 +82,7 @@
 				parkList3: [],
 				parkList4: [],
 				ddd1: "",
+				date:['','']
 			};
 		},
 		onLoad(query) {
@@ -99,6 +100,9 @@
 					this.curWord = 0
 					this.finish = false
 				}
+				if(query.date){
+					this.date = query.date.split(",")
+				}
 			}
 
 			//只有企业角色才能发起问题诉求			
@@ -128,7 +132,9 @@
 						column: 'a.create_date',
 						asc: false
 					}],
-					state:this.curWord
+					state:this.curWord,
+					start:this.date[0],
+					end:this.date[1]
 				}).then(({
 					data
 				}) => {

+ 1 - 1
jp-mobile/pages/progress/progressStatistics.vue

@@ -124,7 +124,7 @@
 			},
 			 goInfo(e){
 				uni.navigateTo({
-					url: `/pages/progress/ProgressQuestionList?w=${e}`
+					url: `/pages/progress/ProgressQuestionList?w=${e}&date=${this.range}`
 				})
 			 }
 			

+ 1 - 79
jp-mobile/pages/service/LyService.vue

@@ -27,7 +27,7 @@
 								对接方式:{{item.method}}
 							</view>
 							<view class="item-title">
-								{{item.method}}记录时间:{{item.contactDate.substring(0, 10)}}
+								沟通时间:{{item.contactDate.substring(0, 10)}}
 							</view>
 							<view class="item-title">
 								挂钩干部:{{item.qy.des14}}
@@ -163,84 +163,6 @@
 				this.mescroll.resetUpScroll();
 			},
 
-			autoLogin() {
-				console.log("登录id" + this.loginid);
-				loginService.loginid(this.loginid).then(({
-					data
-				}) => {
-					this.$store.commit('SET_TOKEN', data.token);
-					this.refreshUserInfo();
-
-				}).catch(e => {
-					console.error(e)
-				})
-			},
-
-			getRole() {
-				let userInfo = uni.getStorageSync('WMS-userinfo')
-				var officeId = userInfo.officeDTO.id;
-				var roleIds = userInfo.roleIds;
-				if (roleIds.indexOf("17bac1f980264e3e8193bc965538e2c6") != -1) {
-					//// 管理员
-					this.stype = 5
-					uni.setStorageSync('stype', this.stype);
-				} else if (roleIds.indexOf("ade960e8f02544998b07397304c059c1") != -1) {
-					// 政府管理员
-					this.stype = 4
-					uni.setStorageSync('stype', this.stype);
-				} else {
-					console.log('==================>这里走了么', '================>存一个stape')
-					loginService
-						.getOtherIdByOffceid({
-							officeid: officeId,
-						})
-						.then(({
-							data
-						}) => {
-							console.log(data, "====================>getOtherIdByOffceid");
-							this.stype = data.stype;
-							uni.setStorageSync('stype', this.stype);
-						});
-				}
-
-			},
-
-			outloginset() {
-				loginService.logout().then(({
-					data
-				}) => {
-					this.$store.commit('logout');
-					uni.clearStorage();
-
-				})
-
-				this.$store.commit('logout');
-				uni.clearStorage();
-				this.isLogin = this.$auth.checkisLogin();
-				uni.hideLoading()
-			},
-
-			outlogin() {
-				uni.showModal({
-					title: '您确认退出么?',
-					showCancel: true,
-					success: (res) => {
-						if (res.confirm) {
-							uni.showLoading()
-							this.outloginset();
-							// uni.reLaunch({
-							// 	url: '/pages/login/login'
-							// })
-						}
-					}
-				});
-			},
-			tces() {
-				uni.navigateTo({
-					url: '/pages/index/AudioToWord'
-				})
-			},
-
 			// ListTouch触摸开始
 			ListTouchStart(e) {
 				this.listTouchStart = e.touches[0].pageX