Forráskód Böngészése

年度评级调整

shaohao521 1 éve
szülő
commit
8c94d9fa08

+ 29 - 34
fangchan_manager/src/main/java/com/mw/platform/DatabaseBackupsTask.java

@@ -1,42 +1,37 @@
 //package com.mw.platform;
 //
-//import com.mw.platform.util.DateUtil;
-//import lombok.SneakyThrows;
-//import org.springframework.scheduling.annotation.Scheduled;
-//import org.springframework.stereotype.Component;
+//import java.io.File;
+//import java.io.IOException;
 //
-//@Component
+////@Component
 //public class DatabaseBackupsTask {
 //
-//    @SneakyThrows
-//    @Scheduled(fixedRate = 1000*60*60*24*7)
-//    public void reportCurrent() {
-//        System.out.println("++++++++++++++++++++数据库备份++++++++++++++++++++++");
-//        StringBuilder cmd = null;
-//        // 实例化cmd对象
-//        cmd = new StringBuilder();
-//        // 一下操作是做cmd命令的拼写
-//        cmd.append("cmd.exe /C mysqldump  -u");
-//        cmd.append("root");
-//        cmd.append(" -p ");
-////        cmd.append("root");
-
-//        cmd.append("db_agent_system");
-//        cmd.append(" > ");
-//        cmd.append("D:/数据库文件");
-//        cmd.append("/" + DateUtil.getCurDate() + "system.sql");
-//        // 获取一个Runtime对象
-//        Runtime r = Runtime.getRuntime();
-//        r.exec(cmd.toString());
-//        System.out.println("数据库备份成功");
-//        /*try {
-//            // 执行cmd备份操作
-//            r.exec(cmd.toString());
-//            System.out.println("数据库备份成功");
-//        } catch (IOException e) {
-//            System.exit(0);
-//        }*/
+//    public static void main(String[] args) throws IOException {
+//        exportDatabaseTool();
+//    }
+//
+////    @Scheduled(cron="0 53 9 ? * *")
+//    public static void exportDatabaseTool() throws IOException {
+//        System.out.println("+++++++++开始++++++++++++++");
+//        String filePath="D:\\数据库文件\\";
+//        String dbName="zl_sg";//备份的数据库名
+//        String username="root";//用户名
+//        String password="root";//密码
+//        String host = "192.168.0.199"; //地址
+//        String port = "3306"; //端口
+//        File uploadDir = new File(filePath);
+//        if (!uploadDir.exists())
+//            uploadDir.mkdirs();
 //
-//        System.out.println("++++++++++++++++++++数据库备份结束++++++++++++++++++++++");
+//        String cmd =  "mysqldump -h"+ host +" -p"+ port +" -u"+ username +"  -p"+password +" "+ dbName + " -r "
+//                + filePath + "/" + dbName+new java.util.Date().getTime()+ ".sql";
+//        try {
+//            System.out.println(cmd);
+//            Process process = Runtime.getRuntime().exec(cmd);
+//            System.out.println("备份数据库成功!!!");
+//        } catch (Exception e) {
+//            // TODO Auto-generated catch block
+//            e.printStackTrace();
+//        }
 //    }
 //}

+ 45 - 11
fangchan_manager/src/main/java/com/mw/platform/controller/ScoreController.java

@@ -10,11 +10,9 @@ import com.mw.platform.core.BaseController;
 import com.mw.platform.core.Example;
 import com.mw.platform.core.ListView;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import java.util.ArrayList;
@@ -42,6 +40,11 @@ public class ScoreController extends BaseController {
     private IJgXwjlService jgXwjlService;
     @Autowired
     private IJgXwjlFjService jgXwjlFjService;
+    /**
+     * 评级类型 1自动评级 2手动评级
+     */
+    @Value("${ndpj.type}")
+    private Integer type;
 
     /**
      * 插入评分表 评分明细表
@@ -71,8 +74,9 @@ public class ScoreController extends BaseController {
     @GetMapping("/list")
     public ModelAndView list() {
         ModelAndView view = new ModelAndView(getPagePath() + "/list");
+        view.addObject("type",type);
+        view.addObject("pjsz",getSysUserInfo().getRoleId() == 1 ? 1 : 0);
         getMenuButtonList();
-
         return view;
     }
 
@@ -92,7 +96,7 @@ public class ScoreController extends BaseController {
         Example<Score> example = new Example<>(score);
         example.setPageSize(pageSize);
         example.setPageNo(pageNo);
-        example.setOrderBy("fz desc");
+        example.setOrderBy("zt,fz desc");
 
         int total = scoreService.totalByExample(example);
         List<Map<String, Object>> list = scoreService.selectByExample(example);
@@ -164,12 +168,42 @@ public class ScoreController extends BaseController {
         return modelAndView;
     }
 
-    /**
-     * 年度评级接口
-     */
+//    /**
+//     * 年度评级接口
+//     */
+//    @PostMapping("/ndpj")
+//    public void ndpj(){
+//        scoreService.ndpj();
+//    }
+
+    @GetMapping("/ndpj")
+    public ModelAndView ndpj(){
+        ModelAndView view = new ModelAndView(getPagePath()+"/ndpj");
+        return view;
+    }
+
     @PostMapping("/ndpj")
-    public void ndpj(){
-        scoreService.ndpj();
+    public String ndpj(@RequestBody Score score) {
+//        String xydj = "";
+//
+//        if (hmdbs == 1){ //已经列入黑名单 直接定位C级
+//            xydj = "C级";
+//        }else {
+//            if (fz >= 130){
+//                xydj = "AAA级";
+//            }else if (fz >= 110){
+//                xydj = "AA级";
+//            }else if (fz >= 100){
+//                xydj = "A级";
+//            }else if (fz >= 80){
+//                xydj = "B级";
+//            }else {
+//                xydj = "C级";
+//            }
+//        }
+//        return xydj;
+
+        return scoreService.ndpj(score);
     }
 
     @Override

+ 32 - 0
fangchan_manager/src/main/java/com/mw/platform/task/JgNdpj.java

@@ -0,0 +1,32 @@
+//package com.mw.platform.task;
+//
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.scheduling.annotation.EnableScheduling;
+//import org.springframework.scheduling.annotation.Scheduled;
+//import org.springframework.stereotype.Component;
+//
+//@Component
+//@EnableScheduling
+//public class JgNdpj {
+//
+//    /**
+//     * 评级类型 1自动评级 2手动评级
+//     */
+//    @Value("${ndpj.type}")
+//    private Integer type;
+//
+//    /**
+//     * 0点40分 扫描已到期的备案 @Scheduled(cron="0 40 00 ? * *")
+//     */
+//    @Scheduled(cron="0 53 9 ? * *")
+//    public void ndpj(){
+//        System.out.println("*********************************");
+//        System.out.println(type);
+//        System.out.println("*********************************");
+//
+//        if (type == 1){
+//            System.out.println(">>>>>>自动评级开始");
+//        }
+//
+//    }
+//}

+ 1 - 1
fangchan_manager/src/main/java/com/mw/platform/task/JgxxbaTask.java

@@ -21,7 +21,7 @@ public class JgxxbaTask {
     private IOrganizationService organizationService;
 
     /**
-     * 0点 扫描已到期的备案
+     * 0点15分 扫描已到期的备案
      */
     @Scheduled(cron="0 15 00 ? * *")
     public void xxbaTask(){

+ 1 - 0
fangchan_manager/src/main/resources/static/js/business/score/list.js

@@ -76,6 +76,7 @@ layui.use([ 'table','form', 'util','laydate' ], function(table) {
 		limit : 10
 	});
 
+
 	//年选择器
 	laydate.render({
 		elem: '#nd',

+ 1 - 1
fangchan_manager/src/main/resources/templates/business/dialog/jgxxgsDialog.html

@@ -2,7 +2,7 @@
 <html>
 <head>
 <meta charset="utf-8">
-<title>淄博市房地产从业机构信息公示</title>
+<title>房地产从业机构信息公示</title>
 <meta name="renderer" content="webkit">
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
 <meta name="viewport"

+ 1 - 1
fangchan_manager/src/main/resources/templates/business/jgXwjl/zgbm/bl_add.html

@@ -236,7 +236,7 @@
 						xydm : $("#xydm").val(),
 						fs : $("#fs").val(),
 						pfnr : $("#pfnr").val(),
-						pfjb : $("#pfjb").val(),不良信用数
+						pfjb : $("#pfjb").val(),
 						xwsx : $("#xwsx").val(),
 						fssj : $("#fssj").val(),
 						yxqz : $("#yxqz").val(),

+ 178 - 13
fangchan_manager/src/main/resources/templates/business/score/list.html

@@ -29,23 +29,188 @@
 								<input type="text" class="layui-input" id="nd" autocomplete="off">
 							</div>
 						</div>
-						<#--<div class="layui-inline">
-							<label class="layui-form-label">信用等级:</label>
-							<div class="layui-input-inline">
-								<select id="xydjbs">
-									<option value="" >全部</option>
-									<option value="3">AAA级</option>
-									<option value="2">AA级</option>
-									<option value="1">A级</option>
-									<option value="0">未评级</option>
-								</select>
-							</div>
-						</div>-->
 					</div>
 				</form>
 			</div>
 		</fieldset>
-		<#include "../../include/authority.html" />
+		<div class="layui-row">
+			<div class="layui-col-md9">
+				<div class="grid-demo grid-demo-bg1">
+					<button id="btn_detail" class="layui-btn layui-btn-sm" >
+						<i class="layui-icon">&#xe6b2;</i>详情
+					</button>
+					<#if type?? && type == 2>
+						<button id="btn_ndpj" class="layui-btn layui-btn-sm" >
+							<i class="layui-icon">&#xe628;</i>年度评级
+						</button>
+					</#if>
+					<#if type?? && type == 2>
+						<button id="btn_ndpj" class="layui-btn layui-btn-sm" >
+							<i class="layui-icon">&#xe628;</i>年度评级
+						</button>
+					</#if>
+				</div>
+			</div>
+			<div class="layui-col-md3">
+				<div class="grid-demo" style="float: right; margin-right: 30px;">
+					<button id="btn_search"
+							class="layui-btn layui-btn-sm layui-btn-normal">
+						<i class="layui-icon">&#xe615;</i>查询
+					</button>
+					<button id="btn_reset"
+							class="layui-btn layui-btn-sm layui-btn-normal">
+						<i class="layui-icon">&#x1002;</i> 重置
+					</button>
+				</div>
+			</div>
+		</div>
+		<table class="layui-table" id="lay_table_main"
+			   lay-data="{id: 'mainTable'}" lay-filter="main"></table>
 	</div>
+	<script src="${request.contextPath }/layui.js" charset="utf-8"></script>
+	<script type="text/javascript">
+		layui.use([ 'table','form', 'util','laydate' ], function(table) {
+			var util = layui.util, $ = layui.jquery;
+			var laydate = layui.laydate;
+			table.render({
+				elem : '#lay_table_main',
+				url : parent.appBaseUri + '/sys/score/list',
+				cols : [ [ {
+					checkbox : true
+				}, {
+					field : 'jgmc',
+					title : '机构名称',
+					align : 'center'
+				}, {
+					field : 'shtyxydm',
+					title : '信用代码',
+					align : 'center'
+				}, {
+					field : 'fr',
+					title : '法人代表',
+					align : 'center'
+				}, {
+					field : 'fz',
+					title : '当前分值',
+					align : 'center'
+				}, {
+					field : 'xydj',
+					title : '信用等级',
+					align : 'center'
+				}, {
+					field : 'nd',
+					title : '评分年度',
+					align : 'center'
+				}, {
+					field : 'q',
+					title : '评分期限',
+					align : 'center',
+					templet : function(d){
+						return d.ksrq + ' 至 ' + d.jzrq;
+					}
+				}, {
+					field : 'state',
+					title : '状态',
+					align : 'center',
+					templet : function(d){
+						if(d.state == 1){
+							return "有效";
+						}else {
+							return "已失效";
+						}
+					}
+				} ] ],
+				id : 'mainTable',
+				page : true,
+				method : 'post',
+				loading : true,
+				height : 'full-235',
+				response : {
+					// 数据状态的字段名称,默认:code
+					statusName : 'status',
+					// 成功的状态码,默认:0
+					statusCode : 200,
+					// 状态信息的字段名称,默认:msg
+					msgName : 'hint',
+					// 数据总数的字段名称,默认:count
+					countName : 'total',
+					// 数据列表的字段名称,默认:data
+					dataName : 'data'
+				},
+				request : {
+					// 页码的参数名称,默认:page
+					pageName : 'pageNo',
+					// 每页数据量的参数名,默认:limit
+					limitName : 'pageSize'
+				},
+				limits : [ 10, 20 ],
+				limit : 10
+			});
+
+			//年选择器
+			laydate.render({
+				elem: '#nd',
+				type: 'year'
+			});
+
+			$('#btn_detail').on('click', function() {
+				var table = layui.table;
+				var $ = layui.$;
+
+				var checkStatus = table.checkStatus('mainTable');
+				if (checkStatus.data.length != 1) {
+					layer.alert('请选择一家机构查看评级详情', {
+						icon : 0
+					});
+					return;
+				}
+				var data = checkStatus.data[0];
+
+				var index = layer.open({
+					title : '[ '+data.jgmc+' ] - 信用评级详细信息',
+					type : 2,
+					area : ['800px','500px'],
+					maxmin: true,
+					content : parent.appBaseUri + '/sys/score/detail?id='+data.id
+				});
+				layer.full(index);
+			});
+
+			$("#btn_ndpj").on('click', function () {
+				layer.open({
+					title : '机构年度信用评级',
+					type : 2,
+					area : ['920px','650px'],
+					maxmin: false,
+					content : parent.appBaseUri + '/sys/score/ndpj'
+				});
+			})
+
+			$('#btn_search').on('click', function() {
+				tableReload();
+			});
+
+			$('#btn_reset').on('click', function() {
+				$("input").val("");
+				$("select").val("");
+				tableReload();
+			});
+		});
+
+		function tableReload() {
+			var table = layui.table;
+			var $ = layui.jquery;
+			table.reload('mainTable', {
+				where : {
+					jgmc : $("#jgmc").val(),
+					nd : $("#nd").val(),
+					xydjbs : $("#xydjbs").val()
+				},
+				page: {
+					curr: 1 //重新从第 1 页开始
+				}
+			});
+		}
+	</script>
 </body>
 </html>

+ 399 - 0
fangchan_manager/src/main/resources/templates/business/score/ndpj.html

@@ -0,0 +1,399 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title></title>
+<meta name="renderer" content="webkit">
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+<meta name="viewport"
+	content="width=device-width, initial-scale=1, maximum-scale=1">
+<link rel="stylesheet" href="${request.contextPath }/css/layui.css" media="all">
+<style type="text/css">
+	.layui-layout-admin .layui-footer {
+		left: 0px;
+		padding: 4px 10px;
+		text-align: right;
+	}
+	.layui-form-label:before {
+		color: red;
+	}
+	.layui-form {
+		margin-top: 10px;
+		margin-right: 10px;
+		margin-left: 10px;
+	}
+	.layui-textarea {
+		width: 513px;
+		min-height: 60px;
+	}
+	.cb-show {
+		float: left;
+		padding: 9px 40px 9px 5px;
+		color: red;
+		display:block;
+	}
+	.layui-table-cell {
+		overflow: visible;
+	}
+	/*.layui-table-box {*/
+	/*	overflow: visible;*/
+	/*}*/
+	/*.layui-table-body {*/
+	/*	overflow: visible;*/
+	/*}*/
+	.layui-form-select dl dd{
+		text-align: left;
+	}
+	.layui-input{
+		height: 28px;
+	}
+	a:hover {
+		cursor: pointer;
+		color: #ff5858;
+	}
+	a {
+		text-decoration: underline;
+		color: red;
+		padding: 0 3px;
+	}
+	.tips{
+		padding: 12px 20px 7px 20px;
+		font-size: 22px;
+		color: #01AAED;
+		font-weight: bolder;
+		display: none;
+	}
+
+	.arrow_box{animation: glow 550ms ease-out infinite alternate; }
+	@keyframes glow {
+		0% {
+			border-color: #f11919;
+			box-shadow: 0 0 5px rgb(253, 54, 54), inset 0 0 5px rgb(255, 0, 0), 0 1px 0 #e98686;
+		}
+		100% {
+			border-color: #ff0000;
+			box-shadow: 0 0 10px rgb(246 120 120), inset 0 0 7px rgb(222 41 41), 0 1px 0 #d83838;
+		}
+	}
+</style>
+</head>
+<body class="layui-layout-bod" style="overflow:auto;">
+<div class="layui-layout layui-layout-admin">
+	<form class="layui-form">
+		<#--<div class="layui-form-item">
+			<div class="layui-inline">
+				<div class="layui-form-label">机构查询:</div>
+				<div class="layui-input-inline">
+					<input type="text" class="layui-input" id="jgmc"
+						   autocomplete="off" placeholder="请输入机构名称查询" >
+				</div>
+				<button class="layui-btn layui-btn-sm" id="btn_search"><i class="layui-icon">&#xe615;</i>查 询</button>
+			</div>
+		</div>-->
+		<div class="tips" id="tips1">
+			共查询到<div class="totalNum" style="display: inline-block;"></div>家机构可进行年度评级,请点击<a onclick="kspj()">开始评级</a>
+		</div>
+		<div class="tips" id="tips2">
+			(<div style="display: inline" class="finishNum"></div> / <div class="totalNum" style="display: inline"></div>)正在评级,请稍候...
+		</div>
+		<div class="tips" style="color: #009688;padding: 5px 20px 0px 20px;" id="tips3">
+			<i class="layui-icon" style="font-size: 22px">&#x1005;</i> 年度评级已完成,可在页面中调整评级结果,调整结束后请点击<a onclick="finish()">评级完成</a>
+			<div class="layui-inline" style="padding-top: 10px;font-size: 15px;color: #666666;">
+				<label class="layui-form-label" style="text-align: left;padding:6px 0 0 0;width: 72px">机构名称:</label>
+				<div class="layui-input-inline">
+					<input type="text" class="layui-input" id="jgmc" autocomplete="off" placeholder="请填入机构全称进行查找"
+						   style="font-weight: 400;height: 30px;width: 300px;border-color: #c8c8c8">
+				</div>
+				<button id="search" class="layui-btn layui-btn-sm" >
+					<i class="layui-icon">&#xe615;</i>查找
+				</button>
+			</div>
+		</div>
+
+		<div class="layui-form-item">
+			<table class="layui-table" id="lay_table_main"
+				   lay-data="{id: 'mainTable'}" lay-filter="main"></table>
+		</div>
+	</form>
+</div>
+</body>
+<script src="${request.contextPath }/layui.js" charset="utf-8"></script>
+<script>
+	layui.use(['form', 'laydate', 'table', 'form'], function() {
+		var $ = layui.$;
+		var table = layui.table;
+		var form = layui.form;
+
+		table.render({
+			elem : '#lay_table_main',
+			url : '${request.contextPath}/sys/score/list',
+			where : {'zt':1},
+			cols : [[{
+				field : 'xh',
+				title : '序号',
+				width : 48,
+				align : 'center',
+				templet : function (d){
+					return d.LAY_TABLE_INDEX + 1;
+				}
+			},{
+				field : 'jgmc',
+				title : '机构名称',
+				width : 280,
+				align : 'left',
+				templet : function (d){
+					var jgmc = d.jgmc;
+					if (jgmc.length > 16){
+						return d.jgmc.substring(0,16)+"..."
+					}else {
+						return jgmc;
+					}
+				}
+			}, {
+				field : 'shtyxydm',
+				title : '信用代码',
+				width : 190,
+				align : 'center'
+			}, {
+				field : 'fz',
+				title : '当前分值',
+				width : 100,
+				align : 'center',
+				templet : function (d){
+					return d.fz + "分"
+				}
+			}, {
+				field : 'pjzt',
+				title : '评级状态',
+				width : 100,
+				align : 'center',
+				templet : function(d){
+					return '<div id="zt'+d.id+'">' +
+							'待评级'+
+						   // '<i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop" style="display: inline-block"></i>' +
+						   '</div>';
+				}
+			}, {
+				field : 'pjjg',
+				title : '评级结果',
+				width : 136,
+				align : 'center',
+				templet : function(d){
+					return '<div id="jg'+d.id+'">' +
+							'-'+
+							// '<select id="jglx">'+
+							// '<option value="1" >房地产经纪机构</option>'+
+							// '<option value="2">房地产评估机构</option>'+
+							// '<option value="3" selected>房地产开发企业</option>'+
+							// '</select>' +
+							'</div>';
+
+				}
+			}] ],
+			id : 'mainTable',
+			page : false,
+			method : 'post',
+			loading : true,
+			height : 'full-110',
+			response : {
+				// 数据状态的字段名称,默认:code
+				statusName : 'status',
+				// 成功的状态码,默认:0
+				statusCode : 200,
+				// 状态信息的字段名称,默认:msg
+				msgName : 'hint',
+				// 数据总数的字段名称,默认:count
+				countName : 'total',
+				// 数据列表的字段名称,默认:data
+				dataName : 'data'
+			},
+			request : {
+				// 页码的参数名称,默认:page
+				pageName : 'pageNo',
+				// 每页数据量的参数名,默认:limit
+				limitName : 'pageSize'
+			},
+			limits : [ 10, 20 ],
+			limit : 20,
+			done: function(res, curr, count){
+				$("#tips1").css("display","block");
+				$(".totalNum").html(count);
+			}
+		});
+
+		window.finish = function (){
+			var arr = [];
+			for (var i=0;i<dataArr.length;i++){
+				var obj = {};
+				obj.id = dataArr[i].id;
+				obj.xydj = $('#select'+dataArr[i].id+' option:selected').text();
+				obj.xydjbs = $('#select'+dataArr[i].id).val();
+				arr.push(obj);
+			}
+			var data = {"scoreList":arr};
+			$.ajax({
+				url : '${request.contextPath}/sys/score/ndpj',
+				type : 'post',
+				data : JSON.stringify(data),
+				contentType: 'application/json',
+				dataType : 'json',
+				success : function(data) {
+					console.log(data)
+					if (data.code) {
+						layer.msg(data.msg, {
+							icon : 1
+						}, function(index) {
+							var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
+							parent.layer.close(index);
+							parent.tableReload();
+						});
+					}
+				},
+				error : function(data, status, e) {
+					layer.alert("操作失败", {
+						icon : 2
+					});
+				}
+			});
+			return false;
+		}
+
+		$("#search").on("click",function(){
+			var jgmc = $("#jgmc").val();
+			if (jgmc != ''){
+				for (var i=0;i<dataArr.length;i++){
+					if (jgmc === dataArr[i].jgmc){
+						var cellHtml = $(".layui-table-main").find("tr[data-index=" + dataArr[i].LAY_TABLE_INDEX + "]");
+						//添加边框闪烁样式
+						cellHtml.addClass("arrow_box");
+						//移除边框闪烁样式
+						setTimeout(function (){
+							cellHtml.removeClass("arrow_box");
+						},2850);
+						var cellTop = cellHtml.offset().top;
+						$(".layui-table-main").scrollTop(cellTop-5);
+						return false;
+					}
+				}
+			}
+			return false;
+		})
+
+
+		var index = 0;
+		var dataArr = [];
+		var setTime = 1;
+		window.kspj = function (){
+			//获取数据
+			dataArr = layui.table.cache["mainTable"]
+			//开启遮罩
+			layer.load(2, {shade: [0.1,'#fff'] });
+			pj();
+			return false;
+		}
+		function pj(){
+			$("#tips1").css("display","none");
+			$("#tips2").css("display","block");
+			$("#tips3").css("display","none");
+			$(".finishNum").html(index+1);
+			if (index == 0){
+				$("#zt"+dataArr[index].id).html("");
+				$("#zt"+dataArr[index].id).html('<i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop" style="display: inline-block"></i>');
+				setTimeout(function (){
+					$("#jg"+dataArr[index].id).html("");
+					$("#jg"+dataArr[index].id).html(getXydj(dataArr[index].fz,dataArr[index].blxxfz,dataArr[index].hmdbs));
+					form.render();
+					$("#zt"+dataArr[index].id).html("");
+					$("#zt"+dataArr[index].id).html('<i class="layui-icon" style="display: inline-block;color: #18ef18;font-weight: 800">&#xe605;</i>');
+					index++;
+					$("#zt"+dataArr[index].id).html("");
+					$("#zt"+dataArr[index].id).html('<i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop" style="display: inline-block"></i>')
+					setTimeout(function (){
+						pj()
+					},setTime);
+				},setTime);
+			}else {
+				$("#jg"+dataArr[index].id).html("");
+				$("#jg"+dataArr[index].id).html(getXydj(dataArr[index].fz,dataArr[index].blxxfz,dataArr[index].hmdbs));
+				form.render();
+				// var cellHtml = $(".layui-table-main").find("tr[data-index=" + dataArr[i].LAY_TABLE_INDEX + "]");
+				// var cellTop = cellHtml.offset().top;
+				// console.log(cellTop)
+				if (index>2){
+					$(".layui-table-main").scrollTop(39*index-100);//
+				}
+				$("#zt"+dataArr[index].id).html("");
+				$("#zt"+dataArr[index].id).html('<i class="layui-icon" style="display: inline-block;color: #18ef18;font-weight: 800">&#xe605;</i>');
+				if (index+1<dataArr.length){
+					index++;
+					$("#zt"+dataArr[index].id).html("");
+					$("#zt"+dataArr[index].id).html('<i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop" style="display: inline-block"></i>')
+					setTimeout(function (){
+						pj()
+					},setTime);
+				}
+				if (index+1 == dataArr.length){
+					layer.closeAll();
+					setTimeout(function (){
+						$("#tips1").css("display","none");
+						$("#tips2").css("display","none");
+						$("#tips3").css("display","block");
+					},1200);
+				}
+			}
+		}
+
+		function getXydj(fz,blxxfz,hemdbs){
+			var xydj = '<select id="select'+dataArr[index].id+'">';
+			if (hemdbs == 1){
+				xydj = xydj + '<option value="5">AAA级</option>' +
+					   '<option value="4">AA级</option>' +
+					   '<option value="3">A级</option>' +
+					   '<option value="2">B级</option>' +
+					   '<option value="1" selected>C级</option>' ;
+			}else {
+				if (fz >= 130){
+					if (blxxfz <= 10){
+						xydj = xydj + '<option value="5" selected>AAA级</option>' +
+								'<option value="4">AA级</option>' +
+								'<option value="3">A级</option>' +
+								'<option value="2">B级</option>' +
+								'<option value="1">C级</option>';
+					}
+				}else if (fz >= 110){
+					if (blxxfz <= 20) {
+						xydj = xydj + '<option value="5">AAA级</option>' +
+								'<option value="4" selected>AA级</option>' +
+								'<option value="3">A级</option>' +
+								'<option value="2">B级</option>' +
+								'<option value="1">C级</option>';
+					}
+				}else if (fz >= 100){
+					if (blxxfz <= 30) {
+						xydj = xydj + '<option value="5">AAA级</option>' +
+								'<option value="4">AA级</option>' +
+								'<option value="3" selected>A级</option>' +
+								'<option value="2">B级</option>' +
+								'<option value="1">C级</option>';
+					}
+				}else if (fz >= 80){
+					if (blxxfz <= 40) {
+						xydj = xydj + '<option value="5">AAA级</option>' +
+								'<option value="4">AA级</option>' +
+								'<option value="3">A级</option>' +
+								'<option value="2" selected>B级</option>' +
+								'<option value="1">C级</option>';
+					}
+				}else {
+					xydj = xydj + '<option value="5">AAA级</option>' +
+							'<option value="4">AA级</option>' +
+							'<option value="3">A级</option>' +
+							'<option value="2">B级</option>' +
+							'<option value="1" selected>C级</option>';
+				}
+			}
+			return xydj+'</select>';
+		}
+	});
+</script>
+</html>

+ 4 - 1
fangchan_mybatis/src/main/java/com/mw/platform/business/mysql/entity/Score.java

@@ -9,6 +9,7 @@ import lombok.Getter;
 import lombok.Setter;
 
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * 机构评分表 Entity
@@ -124,7 +125,7 @@ public class Score implements Serializable {
     private String xydj;
 
     /**
-     * 黑名单标识
+     * 黑名单标识 (年度内是否进入黑名单)0否  1是
      */
     private Integer hmdbs;
 
@@ -138,6 +139,8 @@ public class Score implements Serializable {
      */
     private Integer state;
 
+    private List<Score> scoreList;
+
     public Score() {
     }
 

+ 1 - 1
fangchan_mybatis/src/main/java/com/mw/platform/business/mysql/service/IScoreService.java

@@ -39,5 +39,5 @@ public interface IScoreService extends IService<Score> {
     /**
      * 年度评级
      */
-    void ndpj();
+    String ndpj(Score score);
 }

+ 53 - 2
fangchan_mybatis/src/main/java/com/mw/platform/business/mysql/service/impl/ScoreServiceImpl.java

@@ -5,10 +5,12 @@ import com.mw.platform.business.mysql.dao.ScoreMxMapper;
 import com.mw.platform.business.mysql.entity.Score;
 import com.mw.platform.business.mysql.entity.ScoreMx;
 import com.mw.platform.business.mysql.service.IScoreService;
+import com.mw.platform.core.BaseParameter;
 import com.mw.platform.core.ServiceImpl;
 import com.mw.platform.util.DateUtil;
 import com.mw.platform.util.UUIDUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -27,6 +29,14 @@ public class ScoreServiceImpl extends ServiceImpl<ScoreMapper, Score> implements
     @Autowired
     private ScoreMxMapper scoreMxMapper;
 
+    //评级月
+    @Value("${ndpj.date.month}")
+    private Integer pjy;
+
+    //评级日
+    @Value("${ndpj.date.day}")
+    private Integer pjr;
+
     @Override
     public Score selectByOrgId(Integer orgId) {
         return getBaseMapper().selectByOrgId(orgId);
@@ -44,7 +54,48 @@ public class ScoreServiceImpl extends ServiceImpl<ScoreMapper, Score> implements
 
     @Override
     @Transactional
-    public void ndpj() {
+    public String ndpj(Score s) {
+        //评级结果
+        List<Score> jgList = s.getScoreList();
+
+        for (Score jg : jgList) {
+            Score score = baseMapper.selectByPrimaryKey(jg.getId());
+            score.setJzrq(DateUtil.getCurYear()+"-"+pjy+"-"+pjr);
+            score.setQmfz(score.getFz());
+            score.setZt(2);
+            score.setXydj(jg.getXydj());
+            score.setXydjbs(jg.getXydjbs());
+            getBaseMapper().updateByPrimaryKeySelective(score);
+            //查询评分详情
+            List<ScoreMx> scoreMxList = scoreMxMapper.selectByScoreid(score.getId());
+            //更新评分明细表状态
+            scoreMxMapper.updateZtByScoreId(score.getId(),2);
+            score.setId(null);
+            score.setUuid(UUIDUtils.getUUID());
+            score.setNd(DateUtil.getCurYear());
+            score.setKsrq(DateUtil.getCurYear()+"-"+pjy+"-"+pjr);
+            score.setJzrq("今");
+            score.setSnddjbs(score.getXydjbs());
+            score.setSnddj(score.getXydj());
+            score.setQcfz(score.getFz());
+            score.setQmfz(null);
+            score.setZt(1);
+            //评分表插入新记录
+            int m = getBaseMapper().insertSelective(score);
+            //评分明细表插入新记录
+            int n = scoreMxMapper.insertScoreMxList(score.getId(),scoreMxList);
+            System.out.println("###"+score.getJgmc()+"评分明细表插入新记录:"+n);
+            System.out.println("<<<<<<<<<<<<年度评级结束>>>>>>>>>>>>>>>>>>>");
+        }
+        BaseParameter res = new BaseParameter();
+        res.setMessage("评级完成");
+        res.commit();
+        return res.getContext();
+    }
+
+    /*@Override
+    @Transactional
+    public void ndpj(Score s) {
         System.out.println("<<<<<<<<<<<<年度评级开始>>>>>>>>>>>>>>>>>>>");
         List<Score> scoreList = getBaseMapper().selectByZt(1);
 
@@ -73,7 +124,7 @@ public class ScoreServiceImpl extends ServiceImpl<ScoreMapper, Score> implements
             System.out.println("###"+score.getJgmc()+"评分明细表插入新记录:"+n);
             System.out.println("<<<<<<<<<<<<年度评级结束>>>>>>>>>>>>>>>>>>>");
         }
-    }
+    }*/
 
     public Score pjCommonTool(Score score){
         score.setJzrq("2022-02-28"); //评价截止日期