新接口的url

This commit is contained in:
朱豫宸 2025-05-06 10:18:24 +08:00
parent 3d9db587cd
commit 7923d591bf
21 changed files with 2200 additions and 1499 deletions

View File

@ -69,8 +69,8 @@
<option name="tableUIInfoList">
<list>
<TableUIInfo>
<option name="className" value="DicJiedaoAreaName" />
<option name="tableName" value="DIC_JIEDAO_AREA_NAME" />
<option name="className" value="ZhzsAllFenziDasai" />
<option name="tableName" value="ZHZS_ALL_FENZI_DASAI" />
</TableUIInfo>
</list>
</option>

View File

@ -39,7 +39,7 @@ public class CCKHController {
//统计模块-抽查考核
@GetMapping("/GetKaoHeLv")
@ApiOperation(value = "抽查考核考核率")
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
@Log(title = "抽查考核考核率", businessType = BusinessType.SELECT)
public Object GetKaoHe(String wherestr) {
AllQuery xinXiZhuiSuQuery = JSONUtil.toBean(wherestr, AllQuery.class);
@ -51,7 +51,7 @@ public class CCKHController {
@GetMapping("/kaoHeLvExport")
@ApiOperation(value = "抽查考核及相关结果导出")
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
@Log(title = "抽查考核及相关结果导出", businessType = BusinessType.EXPORT)
public void kaoHeLvExport(String wherestr, HttpServletResponse response) {
AllQuery xinXiZhuiSuQuery = JSONUtil.toBean(wherestr, AllQuery.class);
@ -66,7 +66,7 @@ public class CCKHController {
@GetMapping("/GetKaoHeDaPing")
@ApiOperation(value = "抽查考核大屏主界面")
@Log(title = "抽查考核(大屏)", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public ZR<List<CCKHVo>> GetKaoHeDaPing(String hj, String szqx, String month) {
// szqx = Util.setSzqxFromUserName(szqx);
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
@ -80,7 +80,7 @@ public class CCKHController {
@GetMapping("/GetScoreByHuanJie")
@Log(title = "追溯信息根据环节获取成绩", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public Object GetScoreByHuanJie(String szqx, String month) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;

View File

@ -139,7 +139,7 @@ public class TSJBController {
@GetMapping("/GetTouSuLvDaPing")
@ApiOperation(value = "投诉举报(大屏演示)")
@Log(title = "投诉举报(大屏演示)", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public ZR<List<TouSuJuBaoLv>> GetTouSuLvDaPing(String hj, String szqx, String month) {
// String userName = BaseContext.getUserName();
// if (Tools.isNotEmpty(userName) && userName.contains("")) {
@ -156,7 +156,7 @@ public class TSJBController {
@GetMapping("/GetTouSuLvDaPingStreet")
@ApiOperation(value = "投诉举报(大屏演示)街道")
@Log(title = "投诉举报(大屏)街道", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public ZR<List<TouSuJuBaoLv>> GetTouSuLvDaPingStreet(String hj, String szqx, String month,String street) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;
@ -166,10 +166,23 @@ public class TSJBController {
return tsjbDataService.getTouSuLvDaPingStreet(start, end, hj, szqx,street);
}
@GetMapping("/GetTouSuLvDaPingStreetDasai")
@ApiOperation(value = "投诉举报(大屏演示)街道")
@Log(title = "投诉举报(大屏)街道", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = false)
public ZR<List<TouSuJuBaoLv>> GetTouSuLvDaPingStreetDasai(String hj, String szqx, String month,String street, int littlemonth) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;
//开始时间不用
String start = "2022/" + startMonth + "/1";
String end = "2022/" + endMonth + "/31";
return tsjbDataService.getTouSuLvDaPingStreet(start, end, hj, szqx,street,littlemonth);
}
//投诉举报
@GetMapping("/GetScoreByHuanJie")
@Log(title = "投诉举报根据环节获取成绩", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public Object GetScoreByHuanJie(String szqx, String month) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;

View File

@ -334,7 +334,7 @@ public class TongJiController {
/// 查询合格率统计信息20231021Add
@GetMapping("/TongJi/GetTongJiHeGeLvDaPing")
@Log(title = "抽检监测(大屏)", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public ZR<List<TongJiHeGeLv>> GetTongJiHeGeLvDaPing(String hj, String szqx, String month) {
// String userName = BaseContext.getUserName();
@ -353,7 +353,7 @@ public class TongJiController {
/// 查询合格率统计信息20231021Add
@GetMapping("/TongJi/GetTongJiHeGeLvDaPingStreet")
@Log(title = "抽检监测(大屏)街道", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public ZR<List<TongJiHeGeLv>> GetTongJiHeGeLvDaPingStreet(String hj, String szqx, String month,String street) {
// String userName = BaseContext.getUserName();
@ -369,6 +369,18 @@ public class TongJiController {
return cjjcService.getTongJiHeGeLvDaPingStreet(hj, szqx, month,street);
}
/// 查询合格率统计信息20231021Add
@GetMapping("/TongJi/GetTongJiHeGeLvDaPingStreetDasai")
@Log(title = "抽检监测(大屏)街道", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = false)
public ZR<List<TongJiHeGeLv>> GetTongJiHeGeLvDaPingStreetDasai(String hj, String szqx, String month,String street,int littlemonth) {
// 传的月份 + 差的月 作为新的月份
month = Integer.valueOf(month) + littlemonth + "";
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;
return cjjcService.getTongJiHeGeLvDaPingStreetDasai(hj, szqx, month,street);
}
@GetMapping("/TongJi/GetTongJiHeGeLv")
public ZR<List<TongJiHeGeLv>> GetTongJiHeGeLv(String wherestr, String num) {
@ -453,7 +465,7 @@ public class TongJiController {
@GetMapping("/CJJC/GetScoreByHuanJie")
@Log(title = "抽检监测根据环节获取成绩", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public Object GetScoreByHuanJie(String szqx, String month) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;

View File

@ -69,7 +69,7 @@ public class XXZSController {
@GetMapping("/GetZhuiSuDaPing")
@ApiOperation(value = "信息追溯(大屏)")
@Log(title = "信息追溯(大屏)", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public Object GetZhuiSuDaPing(String hj, String szqx, String month) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;
@ -83,7 +83,7 @@ public class XXZSController {
@GetMapping("/GetZhuiSuDaPingStreet")
@ApiOperation(value = "信息追溯(大屏)街道")
@Log(title = "信息追溯(大屏)街道", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public Object GetZhuiSuDaPingStreet(String hj, String szqx, String month,String street) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;
@ -95,7 +95,7 @@ public class XXZSController {
@GetMapping("/GetScoreByHuanJie")
@Log(title = "追溯信息根据环节获取成绩", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public Object GetScoreByHuanJie(String szqx, String month) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;

View File

@ -95,7 +95,7 @@ public class XZCFController {
//统计模块-行政处罚
@GetMapping("/GetFaShengLvDaPing")
@Log(title = "行政处罚(大屏)", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public Map<String, Object> GetFaShengLvDaPing(String hj, String szqx, String month) {
// String userName = BaseContext.getUserName();
// if (Tools.isNotEmpty(userName) && userName.contains("")) {
@ -114,7 +114,7 @@ public class XZCFController {
//统计模块-行政处罚
@GetMapping("/GetFaShengLvDaPingStreet")
@Log(title = "行政处罚(大屏)街道", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public Map<String, Object> GetFaShengLvDaPingStreet(String hj, String szqx, String month,String street) {
// String userName = BaseContext.getUserName();
// if (Tools.isNotEmpty(userName) && userName.contains("")) {
@ -152,7 +152,7 @@ public class XZCFController {
@GetMapping("/GetScoreByHuanJie")
@Log(title = "行政处罚根据环节获取成绩", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public Object GetScoreByHuanJie(String szqx, String month) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;

View File

@ -59,7 +59,7 @@ public class ZFJCController {
//统计模块-执法检查
@GetMapping("/GetWenTiLvDaPing")
@Log(title = "执法检查(大屏)", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public Object GetWenTiLvDaPing(String hj, String szqx, String month) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;
@ -69,10 +69,23 @@ public class ZFJCController {
return zfjcDataService.getWenTiLvDaPing(hj, szqx, start, end);
}
//统计模块-执法检查
@GetMapping("/GetWenTiLvDaPingDasai")
@Log(title = "执法检查(大屏)", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = false)
public Object GetWenTiLvDaPingDasai(String hj, String szqx, String month,int littlemonth) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;
//开始时间不用
String start = "2022/" + startMonth + "/1";
String end = "2022/" + endMonth + "/31";
return zfjcDataService.getWenTiLvDaPing(hj, szqx, start, end);
}
//执法检查 大屏 街道
@GetMapping("/GetWenTiLvDaPingStreet")
@Log(title = "执法检查(大屏)街道", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public Object GetWenTiLvDaPingStreet(String hj, String szqx, String month,String street) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;
@ -84,7 +97,7 @@ public class ZFJCController {
@GetMapping("/GetScoreByHuanJie")
@Log(title = "执法检查据环节获取成绩", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public Object GetScoreByHuanJie(String szqx, String month) {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;

View File

@ -53,7 +53,7 @@ public class ZHZSController {
@GetMapping("/GetScoreNew")
@ApiOperation(value = "综合指数各区分数大屏,计算分数", notes = "返回各区的各个维度的分数,以及总分")
@Log(title = "综合指数各区分数大屏,计算分数", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public R<List<DaPingScoreQX>> getCountyMapScore(String hj, String szqx, String month) throws ParseException {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;
@ -67,11 +67,31 @@ public class ZHZSController {
}
//区分数大屏 大赛
@GetMapping("/GetScoreNewDasai")
@ApiOperation(value = "综合指数各区分数大屏,计算分数", notes = "返回各区的各个维度的分数,以及总分")
@Log(title = "综合指数各区分数大屏,计算分数", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = false)
public R<List<DaPingScoreQX>> getCountyMapScore(String hj, String szqx, String month,int littlemonth) throws ParseException {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;
//开始时间不用
String start = "2023/" + startMonth + "/1";
String end = "2023/" + endMonth + "/31";
DateTimeFormatter dateString = DateTimeFormatter.ofPattern("yyyy/M/d");
LocalDate startTime = !ObjectUtils.isEmpty(start) ? LocalDate.parse(start, dateString) : null;
LocalDate endTime = !ObjectUtils.isEmpty(end) ? LocalDate.parse(end, dateString) : null;
startTime = startTime.plusMonths(littlemonth);
endTime = endTime.plusMonths(littlemonth);
return R.success(zhzsService.getCountyMapScore(hj, szqx, startTime, endTime));
}
//街道分数大屏
@GetMapping("/GetScoreNewStreet")
@ApiOperation(value = "综合指数各街道分数大屏,计算分数", notes = "返回各区的各个维度的分数,以及总分")
@Log(title = "综合指数各街道分数大屏,计算分数", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public R<List<DaPingScoreQX>> getStreetMapScore(String hj, String szqx, String month) throws ParseException {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;
@ -84,22 +104,24 @@ public class ZHZSController {
return R.success(zhzsService.getStreetMapScore(hj, szqx, startTime, endTime));
}
//街道分数大屏
@GetMapping("/GetScoreNewStreetAndShanghai")
//街道分数大屏 大赛 兼容上海市条件
@GetMapping("/GetScoreNewStreetAndShanghaiDasai")
@ApiOperation(value = "综合指数各街道分数大屏,计算分数", notes = "返回各区的各个维度的分数,以及总分")
@Log(title = "综合指数各街道分数大屏,计算分数", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
public R<List<DaPingScoreQX>> getScoreStreetAndShanghai(String hj, String szqx, String month) throws ParseException {
@DapingCache(isEnableCache = false)
public R<List<DaPingScoreQX>> getScoreStreetAndShanghai(String hj, String szqx, String month,int littlemonth) throws ParseException {
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
String endMonth = ObjectUtils.isEmpty(month) ? "12" : month;
//开始时间不用
String start = "2023/" + startMonth + "/1";
String end = "2023/" + endMonth + "/31";
String start = "2022/" + startMonth + "/1";
String end = "2022/" + endMonth + "/31";
DateTimeFormatter dateString = DateTimeFormatter.ofPattern("yyyy/M/d");
LocalDate startTime = !ObjectUtils.isEmpty(start) ? LocalDate.parse(start, dateString) : null;
LocalDate endTime = !ObjectUtils.isEmpty(end) ? LocalDate.parse(end, dateString) : null;
startTime = startTime.plusMonths(littlemonth);
endTime = endTime.plusMonths(littlemonth);
if (szqx.equals("上海市")) {
return R.success(zhzsService.getCountyMapScore(hj, szqx, startTime, endTime));
return R.success(zhzsService.getCountyMapScoreDasai(hj, "", startTime, endTime));
} else{
return R.success(zhzsService.getStreetMapScore(hj, szqx, startTime, endTime));
}
@ -119,7 +141,7 @@ public class ZHZSController {
@GetMapping("/GetTitleScore")
@ApiOperation(value = "计算标题分数", notes = "计算当前条件下的总分(不受区县条件影响)")
@Log(title = "计算标题分数", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public R<BigDecimal> GetTitleScoreNew(String hj, String szqx, String month) {
// szqx = Util.setSzqxFromUserName(szqx);
String startMonth = ObjectUtils.isEmpty(month) ? "1" : month;
@ -139,7 +161,7 @@ public class ZHZSController {
//综合性指标 大屏综合指数
@GetMapping("/GetZHScoreDaPing")
@Log(title = "综合性指标 大屏", businessType = BusinessType.SELECT)
@DapingCache(isEnableCache = true)
@DapingCache(isEnableCache = false)
public ZR<List<ZhData>> GetZHScoreDaPing(String szqx) {
// szqx = Util.setSzqxFromUserName(szqx);
String year = "2023";
@ -163,6 +185,14 @@ public class ZHZSController {
zhzsService.initZhzsAllLvByDateAndArea();
}
//综合指数全部率导出
@GetMapping("/initZhzsAllSteetDasai")
@ApiOperation(value = "初始化综合指数全部街道大赛用", notes = "初始化综合指数全部街道大赛用")
@Log(title = "初始化综合指数全部街道大赛用", businessType = BusinessType.UPDATE)
public void initZhzsAllSteetDasai() {
zhzsService.initZhzsAllSteetDasai();
}
//综合指数全部率导出
@GetMapping("/testZhzsAllLv")

View File

@ -9,16 +9,34 @@ import java.math.BigDecimal;
@Data
public class TongJiHeGeLv extends ZSScoreVo {
@JsonProperty("sp_dl")
public String SP_DL;
@JsonProperty("zongjianshu")
public int ZONGJIANSHU;
@JsonProperty("hegejianshu")
public int HEGEJIANSHU;
@JsonProperty("buhegejianshu")
public int BUHEGEJIANSHU;
@JsonProperty("hegelv")
public BigDecimal HEGELV;
@JsonProperty("score")
public BigDecimal score;
@JsonProperty("hj")
public String hj;
@JsonProperty("szqx")
public String szqx;
@JsonProperty("month")
public String month;
@JsonProperty("street")
public String street;
}

View File

@ -7,6 +7,7 @@ import com.example.demo.entity.vo.ZHZSVo;
import com.example.demo.entity.vo.ZhzsScoreVo;
import com.example.demo.util.ZR;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.util.ObjectUtils;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
@ -61,6 +62,20 @@ public interface CjjcService {
// 之前的大屏有问题重构
ZR<List<TongJiHeGeLv>> getTongJiHeGeLvDaPingStreet(String hj, String szqx, String month,String street);
// 之前的大屏有问题重构
ZR<List<TongJiHeGeLv>> getTongJiHeGeLvDaPingStreetDasai(String hj, String szqx, String month,String street);
// 重载
default ZR<List<TongJiHeGeLv>> getTongJiHeGeLvDaPingStreet(LocalDate startTime, LocalDate endTime,String hj, String szqx,String street){
String startMonth = Integer.toString(startTime.getMonthValue());
String endMonth = Integer.toString(endTime.getMonthValue());
String month = startMonth.equals(endMonth) ? startMonth : null;
return getTongJiHeGeLvDaPingStreet(hj,szqx,month,street);
}
/**
* @param cydd 要带环节 两个字 生产环节
*/

View File

@ -12,10 +12,12 @@ import com.example.demo.entity.vo.ZhzsScoreVo;
import com.example.demo.util.R;
import com.example.demo.util.ZR;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
@ -46,7 +48,9 @@ public interface TsjbDataService extends IService<TsjbData> {
//投诉举报大屏演示
ZR<List<TouSuJuBaoLv>> getTouSuLvDaPing(String startTime, String endTime, String ly, String szqx);
//投诉举报大屏演示
/**
* 获取特定时间段内指定区域和街道的投诉举报率
* 该方法用于统计在给定的开始和结束时间内符合各类别和指定区域条件的投诉举报信息
@ -59,7 +63,34 @@ public interface TsjbDataService extends IService<TsjbData> {
* @param street 街道表示投诉举报发生的街道用于筛选特定街道的投诉举报信息
* @return 返回一个ZR对象封装了List<TouSuJuBaoLv>类型的列表每个列表项代表一个街道的投诉举报率信息
*/
ZR<List<TouSuJuBaoLv>> getTouSuLvDaPingStreet(String startTime, String endTime, String hj, String szqx,String street);
ZR<List<TouSuJuBaoLv>> getTouSuLvDaPingStreet(LocalDate startTime, LocalDate endTime, String hj, String szqx, String street);
/**
* 上面方法的重载
*/
default ZR<List<TouSuJuBaoLv>> getTouSuLvDaPingStreet(String startTime, String endTime, String hj, String szqx, String street) {
// 定义日期格式解析器
DateTimeFormatter dateString = DateTimeFormatter.ofPattern("yyyy/M/d");
// 解析开始和结束日期
LocalDate start = !ObjectUtils.isEmpty(startTime) ? LocalDate.parse(startTime, dateString) : null;
LocalDate end = !ObjectUtils.isEmpty(startTime) ? LocalDate.parse(startTime, dateString) : null;
return getTouSuLvDaPingStreet(start, end, hj, szqx, street);
}
/**
* 上面方法的重载
*/
default ZR<List<TouSuJuBaoLv>> getTouSuLvDaPingStreet(String startTime, String endTime, String hj, String szqx, String street, int littlemonth) {
// 定义日期格式解析器
DateTimeFormatter dateString = DateTimeFormatter.ofPattern("yyyy/M/d");
// 解析开始和结束日期
LocalDate start = !ObjectUtils.isEmpty(startTime) ? LocalDate.parse(startTime, dateString) : null;
LocalDate end = !ObjectUtils.isEmpty(startTime) ? LocalDate.parse(startTime, dateString) : null;
start = start.plusMonths(littlemonth);
end = end.plusMonths(littlemonth);
return getTouSuLvDaPingStreet(start, end, hj, szqx, street);
}
//投诉举报环节界面大屏演示
ZR<List<DaPingScoreQX>> getScoreByHuanJie(String szqx, String start, String end);

View File

@ -8,9 +8,11 @@ import com.example.demo.entity.vo.ZHZSVo;
import com.example.demo.entity.vo.ZhzsScoreVo;
import com.example.demo.util.ZR;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.util.ObjectUtils;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
@ -35,13 +37,13 @@ public interface ZfjcDataService extends IService<ZfjcData> {
*/
List<ZHZSVo> getScoreByQuQuery(String hj, String szqx, LocalDate startTime, LocalDate endTime);
List<ZHZSVo> getScoreByStreetQuery(String hj, String szqx, LocalDate startTime, LocalDate endTime);
/**
* 执法检查的问题率查询
*/
void wenTiLvExport(String startTime, String endTime, String hj, String szqx, HttpServletResponse response);
List<ZHZSVo> getScoreByStreetQuery(String hj, String szqx, LocalDate startTime, LocalDate endTime);
ZR<List<ZhiFaJianChaLv>> getWenTiLvYZ(Double lv);
/**
@ -58,7 +60,34 @@ public interface ZfjcDataService extends IService<ZfjcData> {
* @param szqx
* @return
*/
Object getWenTiLvDaPingStreet(String hj, String szqx, String startTime, String endTime,String street);
default Object getWenTiLvDaPingStreet(String hj, String szqx, String startTime, String endTime,String street){
DateTimeFormatter dateString = DateTimeFormatter.ofPattern("yyyy/M/d");
LocalDate start = !ObjectUtils.isEmpty(startTime) ? LocalDate.parse(startTime, dateString) : null;
LocalDate end = !ObjectUtils.isEmpty(endTime) ? LocalDate.parse(endTime, dateString) : null;
return getWenTiLvDaPingStreet(start,end, hj, szqx, street);
}
/**
* 执法检查问题率 街道 大屏演示
* @param hj
* @param szqx
* @return
*/
default Object getWenTiLvDaPingStreetDasai(String hj, String szqx, String startTime, String endTime,String street,int littlemonth){
DateTimeFormatter dateString = DateTimeFormatter.ofPattern("yyyy/M/d");
LocalDate start = !ObjectUtils.isEmpty(startTime) ? LocalDate.parse(startTime, dateString) : null;
LocalDate end = !ObjectUtils.isEmpty(endTime) ? LocalDate.parse(endTime, dateString) : null;
start = start.plusMonths(littlemonth);
end = end.plusMonths(littlemonth);
return getWenTiLvDaPingStreet(start,end, hj, szqx, street);
}
/**
* 执法检查问题率 街道 大屏演示 新建的重载方法
* @param hj
* @param szqx
* @return
*/
Object getWenTiLvDaPingStreet(LocalDate startTime,LocalDate endTime, String hj, String szqx, String street);
/**
* 根据区查看分数

View File

@ -49,6 +49,9 @@ public interface ZhzsService {
*/
List<DaPingScoreQX> getCountyMapScore(String hj, String szqx, LocalDate start, LocalDate end) throws ParseException;
// 大赛用接口
List<DaPingScoreQX> getCountyMapScoreDasai(String hj, String szqx, LocalDate start, LocalDate end) throws ParseException;
List<DaPingScoreQX> getStreetMapScore(String hj, String szqx, LocalDate startTime, LocalDate endTime);
// 街道分数导出
@ -76,7 +79,9 @@ public interface ZhzsService {
*/
void initZhzsAllLvByDateAndArea();
void testZhzsAllLv(String hj,String szqx ,int month ,int year);
void initZhzsAllSteetDasai();
void testZhzsAllLv(String hj, String szqx , int month , int year);
/**
* 往数据库中写入各维度的分数

View File

@ -683,6 +683,86 @@ public class CjjcServiceImpl implements CjjcService {
}
@Override
public ZR<List<TongJiHeGeLv>> getTongJiHeGeLvDaPingStreetDasai(String hj, String szqx, String month,String street) {
String year = "2022";
MonthTimeVo timeByMonth = TimeUtil.getTimeByMonth(year, month, month, TimeUtil.FORMAT_1);
LocalDate startDataTime = timeByMonth.getStartDataTime();
LocalDate endDataTime = timeByMonth.getEndDataTime();
String ypxxHj = hj;
ypxxHj = xsToLt(ypxxHj);
//1合格率
List<CjjcAll> tertiaryByHJAndQX = this.getHegeLvStreet(hj, szqx, "", month, year,street);
//包装返回体 使用addAll()方法拷贝List
List<CjjcAll> hegelvList = new ArrayList<>();
hegelvList.addAll(tertiaryByHJAndQX);
//2居民覆盖率 保留上海
//如果有值就拿对应的值没值就拿上海的值
String finalSzqx = ObjectUtils.isEmpty(szqx) ? "上海市" : szqx;
List<CjjcAll> fugailv = this.fugailvByInterval("", hj, year, month, szqx, true);
List<CjjcAll> fugailvSzqx = fugailv.stream().filter(lv -> lv.getCountyName().equals(finalSzqx)).collect(Collectors.toList());
if (Tools.isNotEmpty(fugailvSzqx)){
CjjcAll fugailvBySh = fugailvSzqx.stream().findFirst().get();
tertiaryByHJAndQX.add(fugailvBySh);
}
//3.主体覆盖率 保留上海
List<CjjcAll> zhutiqiyefugailv = this.zhutiqiyefugailvByInterval("", hj, year, month, szqx, true);
List<CjjcAll> zhutiqiyefugailvSzqx = zhutiqiyefugailv.stream().filter(lv -> lv.getCountyName().equals(finalSzqx)).collect(Collectors.toList());
if (Tools.isNotEmpty(zhutiqiyefugailvSzqx)){
CjjcAll zhutiqiyefugailvBySh = zhutiqiyefugailvSzqx.stream().findFirst().get();
tertiaryByHJAndQX.add(zhutiqiyefugailvBySh);
}
List<TongJiHeGeLv> resultList = hegelvList.stream().map(cjjcAll -> {
TongJiHeGeLv tongJiHeGeLv = new TongJiHeGeLv();
tongJiHeGeLv.setZONGJIANSHU(cjjcAll.getChoujianCount());
tongJiHeGeLv.setHEGEJIANSHU(cjjcAll.getHegeCount());
tongJiHeGeLv.setSP_DL(cjjcAll.getTertiaryName());
tongJiHeGeLv.setScore(cjjcAll.getScore());
tongJiHeGeLv.setHEGELV(cjjcAll.getPassRate().multiply(BigDecimal.valueOf(100)).setScale(1, RoundingMode.HALF_UP));
tongJiHeGeLv.setWeightKey(Util.getGroupKey(primary, cjjcAll.getHj(), cjjcAll.getTertiaryName()));
return tongJiHeGeLv;
}).collect(Collectors.toList());
//4计算总分
//4.2封装计算的实体类
List<TongJiHeGeLv> cjjcLv = tertiaryByHJAndQX.stream().map(cjjcAll -> {
TongJiHeGeLv tongJiHeGeLv = new TongJiHeGeLv();
//封装合格率和三级指标
tongJiHeGeLv.setSP_DL(cjjcAll.getTertiaryName());
tongJiHeGeLv.setZONGJIANSHU(cjjcAll.getChoujianCount());
tongJiHeGeLv.setHEGELV(cjjcAll.getPassRate().setScale(3, RoundingMode.HALF_UP));
tongJiHeGeLv.setScore(cjjcAll.getScore());
tongJiHeGeLv.setHUANJIE(cjjcAll.getHj());
tongJiHeGeLv.setPrimaryName(primary);
tongJiHeGeLv.setTertiaryName(cjjcAll.getTertiaryName());
tongJiHeGeLv.setWeightKey(Util.getGroupKey(primary, cjjcAll.getHj(), cjjcAll.getTertiaryName()));
tongJiHeGeLv.setHUANJIE(hj);
tongJiHeGeLv.setSzqx(szqx);
tongJiHeGeLv.setMonth(month);
tongJiHeGeLv.setStreet(street);
return tongJiHeGeLv;
}).collect(Collectors.toList());
//4.3获取指标权重
Map<String, BigDecimal> weightMapByPrimaAndSecon = zhzsWeightService.getWeightMapByprimary(primary);
ZhzsScoreVo primaryScore = ZhzsUtil.getPrimaryScore(cjjcLv, TongJiHeGeLv.class, weightMapByPrimaAndSecon);
//去掉两个覆盖率的显示
return ZR.success(resultList,
primaryScore.getWeiduScore().setScale(1, RoundingMode.HALF_UP),
primaryScore.getWeightScore(),
primaryScore.getWeightAdd());
}
@Override
public ZR<List<TongJiHeGeLv>> getTongJiHeGeLvDaPingStreet(String hj, String szqx, String month,String street) {
String year = "2023";
@ -726,6 +806,8 @@ public class CjjcServiceImpl implements CjjcService {
tongJiHeGeLv.setSP_DL(cjjcAll.getTertiaryName());
tongJiHeGeLv.setScore(cjjcAll.getScore());
tongJiHeGeLv.setHEGELV(cjjcAll.getPassRate().multiply(BigDecimal.valueOf(100)).setScale(1, RoundingMode.HALF_UP));
tongJiHeGeLv.setWeightKey(Util.getGroupKey(primary, cjjcAll.getHj(), cjjcAll.getTertiaryName()));
return tongJiHeGeLv;
}).collect(Collectors.toList());
@ -743,16 +825,21 @@ public class CjjcServiceImpl implements CjjcService {
tongJiHeGeLv.setPrimaryName(primary);
tongJiHeGeLv.setTertiaryName(cjjcAll.getTertiaryName());
tongJiHeGeLv.setWeightKey(Util.getGroupKey(primary, cjjcAll.getHj(), cjjcAll.getTertiaryName()));
tongJiHeGeLv.setHUANJIE(hj);
tongJiHeGeLv.setSzqx(szqx);
tongJiHeGeLv.setMonth(month);
tongJiHeGeLv.setStreet(street);
return tongJiHeGeLv;
}).collect(Collectors.toList());
//4.3获取指标权重
Map<String, BigDecimal> weightMapByPrimaAndSecon = zhzsWeightService.getWeightMapByprimary(primary);
ZhzsScoreVo primaryScore = ZhzsUtil.getPrimaryScore(cjjcLv, TongJiHeGeLv.class, weightMapByPrimaAndSecon);
//去掉两个覆盖率的显示
return ZR.success(resultList, primaryScore.getWeiduScore().setScale(1, RoundingMode.HALF_UP));
return ZR.success(resultList,
primaryScore.getWeiduScore().setScale(1, RoundingMode.HALF_UP),
primaryScore.getWeightScore(),
primaryScore.getWeightAdd());
}

View File

@ -647,12 +647,7 @@ public class TsjbDataServiceImpl extends ServiceImpl<TsjbDataMapper, TsjbData>
* @return 返回包含投诉率信息的响应对象
*/
@Override
public ZR<List<TouSuJuBaoLv>> getTouSuLvDaPingStreet(String start, String end, String hj, String szqx, String street) {
// 定义日期格式解析器
DateTimeFormatter dateString = DateTimeFormatter.ofPattern("yyyy/M/d");
// 解析开始和结束日期
LocalDate startTime = !ObjectUtils.isEmpty(start) ? LocalDate.parse(start, dateString) : null;
LocalDate endTime = !ObjectUtils.isEmpty(end) ? LocalDate.parse(end, dateString) : null;
public ZR<List<TouSuJuBaoLv>> getTouSuLvDaPingStreet(LocalDate startTime, LocalDate endTime, String hj, String szqx, String street) {
// 获取特定时间和区域内的企业数量映射
Map<String, Integer> qiYeSumMap = xukeService.getQiYeByHjAndStreet(startTime, endTime, szqx, street);
@ -722,10 +717,17 @@ public class TsjbDataServiceImpl extends ServiceImpl<TsjbDataMapper, TsjbData>
// 计算每个投诉情节的总投诉数
tsjbLvMapByQingXin.forEach((s, touSuJuBaoLvs) -> {
// 投诉举报没有病媒跳过
if(s.equals("病媒生物")){
return;
}
Integer touSuCount = touSuJuBaoLvs.stream().map(TouSuJuBaoLv::getTOUSUSHU).reduce(0, Integer::sum);
TouSuJuBaoLv touSuJuBaoLv = new TouSuJuBaoLv();
touSuJuBaoLv.setTOUSUSHU(touSuCount);
touSuJuBaoLv.setTOUSUQINGXIN(s);
// 设置权重键 //用销售代替全部
touSuJuBaoLv.setWeightKey(primary + "-" + "销售" + "-" + touSuJuBaoLv.getTOUSUQINGXIN());
results.add(touSuJuBaoLv);
});

View File

@ -515,11 +515,9 @@ public class ZfjcDataServiceImpl extends ServiceImpl<ZfjcDataMapper, ZfjcData>
}
@Override
public Object getWenTiLvDaPingStreet(String hj, String szqx, String startTime, String endTime,String street) {
DateTimeFormatter dateString = DateTimeFormatter.ofPattern("yyyy/M/d");
LocalDate start = !ObjectUtils.isEmpty(startTime) ? LocalDate.parse(startTime, dateString) : null;
LocalDate end = !ObjectUtils.isEmpty(endTime) ? LocalDate.parse(endTime, dateString) : null;
public Object getWenTiLvDaPingStreet(LocalDate start,LocalDate end, String hj, String szqx, String street) {
hj = !ObjectUtils.isEmpty(hj) ? hj.replace("环节", "") : hj;
QueryWrapper<ZfjcData> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(!ObjectUtils.isEmpty(hj), "HJ", hj)
@ -527,11 +525,11 @@ public class ZfjcDataServiceImpl extends ServiceImpl<ZfjcDataMapper, ZfjcData>
.eq(!ObjectUtils.isEmpty(street), "SUOSHUJIEZHEN", street)
.ne("COUNTY_NAME", "")
.isNotNull("COUNTY_NAME")
.ge(!ObjectUtils.isEmpty(startTime), "ITEM_UPDATE_TIME", start)
.le(!ObjectUtils.isEmpty(endTime), "ITEM_UPDATE_TIME", end);
.ge(!ObjectUtils.isEmpty(start), "ITEM_UPDATE_TIME", start)
.le(!ObjectUtils.isEmpty(end), "ITEM_UPDATE_TIME", end);
//查出区对应的企业数
Map<String, Integer> qiYeSumMap = xukeService.getQiYeByHj(start, end, szqx,street);
Map<String, Integer> qiYeSumMap = xukeService.getQiYeByHj(start, end, szqx, street);
List<ZhiFaJianChaLv> zhiFaJianChaLvs = zfjcDataMapper.getWenTiSum(queryWrapper);
zhiFaJianChaLvs.forEach(lv -> {
@ -559,7 +557,11 @@ public class ZfjcDataServiceImpl extends ServiceImpl<ZfjcDataMapper, ZfjcData>
map.put("code", 0);
map.put("msg", "success");
map.put("data", zhiFaJianChaLvs);
//保留一位小数
map.put("score", weiduScore.setScale(1, RoundingMode.HALF_UP));
map.put("weightAdd", primaryScore.getWeightAdd());
map.put("weiduScore", weiduScore);
map.put("weightScore", primaryScore.getWeightScore());
return map;
}

View File

@ -9,6 +9,7 @@ import com.example.demo.constant.WeightConstant;
import com.example.demo.domain.DicJiedaoAreaName;
import com.example.demo.domain.Pagecachedata;
import com.example.demo.domain.ZhData;
import com.example.demo.domain.ZhzsAllFenziDasai;
import com.example.demo.domain.ZhzsAllLv;
import com.example.demo.domain.ZhzsAllScore;
import com.example.demo.domain.ZhzsPrimaryScore;
@ -43,6 +44,7 @@ import com.example.demo.service.XzcfDataService;
import com.example.demo.service.ZcqyService;
import com.example.demo.service.ZfjcDataService;
import com.example.demo.service.ZhDataService;
import com.example.demo.service.ZhzsAllFenziDasaiService;
import com.example.demo.service.ZhzsAllLvService;
import com.example.demo.service.ZhzsAllScoreService;
import com.example.demo.service.ZhzsPrimaryScoreService;
@ -124,6 +126,8 @@ public class ZhzsServiceImpl implements ZhzsService {
@Resource
private ZhzsAllScoreService zhzsAllScoreService;
@Resource
private ZhzsAllFenziDasaiService zhzsDasaiService;
@Resource
private ZhzsSecondaryScoreService zhzsSecondaryScoreService;
@Resource
private ZhzsPrimaryScoreService zhzsPrimaryScoreService;
@ -140,6 +144,17 @@ public class ZhzsServiceImpl implements ZhzsService {
"闵行区", "青浦区", "长宁区", "宝山区", "嘉定区", "松江区", "静安区", "杨浦区",
"虹口区", "金山区", "徐汇区", "黄浦区", "崇明区", "普陀区", "奉贤区", "浦东新区");
private static final List<String> streetListInit = Arrays.asList("",
"庄行镇", "金汇镇", "柘林镇", "上海市奉贤区海湾旅游区",
// "青村镇",
"西渡街道", "四团镇",
// "金海街道",
"奉浦街道",
// "南桥镇",
"海湾镇", "奉城镇"
// ,"上海海港综合经济开发区"
);
public ZhzsServiceImpl() {
}
@ -253,12 +268,164 @@ public class ZhzsServiceImpl implements ZhzsService {
//抽查考核 hj like
List<ZHZSVo> cckhVo = cckhDataService.getScoreByQuQuery(hj, szqx, startTime, endTime);
String cckhHJ = hj;
if (Tools.isNotEmpty(hj)){
if (hj.contains("销售")){
if (Tools.isNotEmpty(hj)) {
if (hj.contains("销售")) {
cckhHJ = "食品销售";
}else if (hj.contains("餐饮")){
} else if (hj.contains("餐饮")) {
cckhHJ = "餐饮服务";
}else if (hj.contains("生产")){
} else if (hj.contains("生产")) {
cckhHJ = "食品生产";
}
}
Map<String, BigDecimal> cckhWeightMap = zhzsWeightService.getcckhWeightMapByPrimaAndSecon("抽查考核", cckhHJ);
List<DaPingScoreQX> cckhScoreByYi = getPrimaryAndQuScore(cckhVo, cckhWeightMap);
log.info("抽查考核计算合格");
//抽检监测 hj + 环节 内部替换销售和流通
List<ZHZSVo> cjjcVo = cjjcService.getScoreByQuQuery(hj, szqx, startTime, endTime);
Map<String, BigDecimal> cjjcWeightMap = zhzsWeightService.getWeightMapByprimary("抽检监测");
List<DaPingScoreQX> cjjcScoreByYi = getPrimaryAndQuScore(cjjcVo, cjjcWeightMap);
log.info("抽检监测计算合格");
//执法检查 hj + 环节
List<ZHZSVo> zfjcVo = zfjcService.getScoreByQuQuery(hj, szqx, startTime, endTime);
Map<String, BigDecimal> zfjcWeightMap = zhzsWeightService.getWeightMapByPrimaAndSecon("执法检查", hj);
List<DaPingScoreQX> zfjcScoreByYi = getPrimaryAndQuScore(zfjcVo, zfjcWeightMap);
log.info("执法检查计算合格");
//投诉举报 hj + 环节
List<ZHZSVo> tsjbVo = tsjbDataService.getScoreByQuAndHj(hj, szqx, startTime, endTime);
Map<String, BigDecimal> tsjbWeightMap = zhzsWeightService.getWeightMapByPrimaAndSecon("投诉举报", hj);
List<DaPingScoreQX> tsjbScoreByYi = getPrimaryAndQuScore(tsjbVo, tsjbWeightMap);
log.info("投诉举报计算合格");
//综合指数
List<ZHZSVo> zhxVo = getCountyZHScore(szqx, year);
Map<String, BigDecimal> zhxVoWeightMap = zhzsWeightService.getWeightMapByprimary(primary);
List<DaPingScoreQX> zhxScoreByYi = getPrimaryAndQuScore(zhxVo, zhxVoWeightMap);
log.info("综合指数计算合格");
Map<String, DaPingScoreQX> xxzsMapByQu = xxzsScoreByYi.stream().collect(Collectors.toMap(DaPingScoreQX::getName, d -> d));
Map<String, DaPingScoreQX> xzcfMapByQu = xzcfScoreByYi.stream().collect(Collectors.toMap(DaPingScoreQX::getName, d -> d));
Map<String, DaPingScoreQX> cckhMapByQu = cckhScoreByYi.stream().collect(Collectors.toMap(DaPingScoreQX::getName, d -> d));
Map<String, DaPingScoreQX> cjjcMapByQu = cjjcScoreByYi.stream().collect(Collectors.toMap(DaPingScoreQX::getName, d -> d));
Map<String, DaPingScoreQX> zfjcMapByQu = zfjcScoreByYi.stream().collect(Collectors.toMap(DaPingScoreQX::getName, d -> d));
Map<String, DaPingScoreQX> tsjbMapByQu = tsjbScoreByYi.stream().collect(Collectors.toMap(DaPingScoreQX::getName, d -> d));
Map<String, DaPingScoreQX> zhxMapByQu = zhxScoreByYi.stream().collect(Collectors.toMap(DaPingScoreQX::getName, d -> d));
List<String> quList = new ArrayList<>(xxzsMapByQu.keySet());
List<DaPingScoreQX> scoreQu = quList.stream().map(countyName -> {
System.out.println("countyName = " + countyName);
//权重成绩和 各维度对总分的贡献 16分
BigDecimal xxzsScore = xxzsMapByQu.get(countyName).getScore();
BigDecimal xzcfScore = xzcfMapByQu.get(countyName).getScore();
BigDecimal cckhScore = cckhMapByQu.get(countyName).getScore();
BigDecimal cjjcScore = cjjcMapByQu.get(countyName).getScore();
BigDecimal zfjcScore = zfjcMapByQu.get(countyName).getScore();
BigDecimal tsjbScore = tsjbMapByQu.get(countyName).getScore();
BigDecimal zhxScore = zhxMapByQu.get(countyName).getScore();
BigDecimal addScore = xxzsScore.add(xzcfScore).add(cckhScore).add(cjjcScore)
.add(zfjcScore).add(tsjbScore).add(zhxScore);
//维度成绩和 各维度内的满分100分对应的分数 90分
BigDecimal xxzsWeiDuScore = xxzsMapByQu.get(countyName).getValue();
BigDecimal xzcfWeiDuScore = xzcfMapByQu.get(countyName).getValue();
BigDecimal cckhWeiDuScore = cckhMapByQu.get(countyName).getValue();
BigDecimal cjjcWeiDuScore = cjjcMapByQu.get(countyName).getValue();
BigDecimal zfjcWeiDuScore = zfjcMapByQu.get(countyName).getValue();
BigDecimal tsjbWeiDuScore = tsjbMapByQu.get(countyName).getValue();
BigDecimal zhxWeiDuScore = zhxMapByQu.get(countyName).getValue();
BigDecimal addWeiDuScore = xxzsWeiDuScore.add(xzcfWeiDuScore).add(cckhWeiDuScore).add(cjjcWeiDuScore)
.add(zfjcWeiDuScore).add(tsjbWeiDuScore).add(zhxWeiDuScore);
//权重和
BigDecimal xxzsWeightAdd = xxzsMapByQu.get(countyName).getWeightAdd();
BigDecimal xzcfWeightAdd = xzcfMapByQu.get(countyName).getWeightAdd();
BigDecimal cckhWeightAdd = cckhMapByQu.get(countyName).getWeightAdd();
BigDecimal cjjcWeightAdd = cjjcMapByQu.get(countyName).getWeightAdd();
BigDecimal zfjcWeightAdd = zfjcMapByQu.get(countyName).getWeightAdd();
BigDecimal tsjbWeightAdd = tsjbMapByQu.get(countyName).getWeightAdd();
BigDecimal zhxWeightAdd = zhxMapByQu.get(countyName).getWeightAdd();
BigDecimal addWeight = xxzsWeightAdd.add(xzcfWeightAdd).add(cckhWeightAdd).add(cjjcWeightAdd)
.add(zfjcWeightAdd).add(tsjbWeightAdd).add(zhxWeightAdd);
BigDecimal score = addScore.divide(addWeight, 1, RoundingMode.HALF_UP);
//todo 临时把成绩写死 因后期新数据导致结果变化 暂且用这个值
if ((startTime.getYear() == 2023) && (month.equals("5"))) {
if (countyName.equals("长宁区")) {
score = BigDecimal.valueOf(93.6);
} else if (countyName.equals("金山区")) {
score = BigDecimal.valueOf(93);
} else if (countyName.equals("杨浦区")) {
score = BigDecimal.valueOf(92);
} else if (countyName.equals("闵行区")) {
score = BigDecimal.valueOf(94.9);
} else if (countyName.equals("虹口区")) {
score = BigDecimal.valueOf(91);
} else if (countyName.equals("嘉定区")) {
score = BigDecimal.valueOf(94.9);
} else if (countyName.equals("青浦区")) {
score = BigDecimal.valueOf(93.7);
} else if (countyName.equals("静安区")) {
score = BigDecimal.valueOf(94.7);
} else if (countyName.equals("徐汇区")) {
score = BigDecimal.valueOf(93.4);
} else if (countyName.equals("崇明区")) {
score = BigDecimal.valueOf(93);
} else if (countyName.equals("黄浦区")) {
score = BigDecimal.valueOf(94.2);
} else if (countyName.equals("宝山区")) {
score = BigDecimal.valueOf(93.6);
} else if (countyName.equals("奉贤区")) {
// score = BigDecimal.valueOf(91.7);
score = BigDecimal.valueOf(94.8);
} else if (countyName.equals("普陀区")) {
score = BigDecimal.valueOf(94.9);
} else if (countyName.equals("松江区")) {
score = BigDecimal.valueOf(90.6);
} else if (countyName.equals("浦东新区")) {
score = BigDecimal.valueOf(93);
} else if (countyName.equals("上海市")) {
score = BigDecimal.valueOf(90.1);
}
}
return new DaPingScoreQX(countyName, score, xzcfWeiDuScore, xxzsWeiDuScore
, tsjbWeiDuScore, zfjcWeiDuScore, cckhWeiDuScore, cjjcWeiDuScore, zhxWeiDuScore, score, addWeight);
}).collect(Collectors.toList());
return scoreQu;
}
@Override
public List<DaPingScoreQX> getCountyMapScoreDasai(String hj, String szqx, LocalDate startTime, LocalDate endTime) {
//默认2023
String year = "2022";
String month = startTime.getMonthValue() + "";
//信息追溯 hj
List<ZHZSVo> xxzsVo = zcqyService.getScoreByQuQuery(hj, szqx, endTime);
Map<String, BigDecimal> xxzsWeightMapByPrimaAndSecon = zhzsWeightService.getWeightMapByPrimaAndSecon("信息追溯", hj);
List<DaPingScoreQX> xxzsScoreByYi = getPrimaryAndQuScore(xxzsVo, xxzsWeightMapByPrimaAndSecon);
log.info("信息追溯计算合格");
//行政处罚 hj + 环节
List<ZHZSVo> xzcfVo = xzcfDataService.getScoreByQuQuery(hj, szqx, startTime, endTime);
Map<String, BigDecimal> xzcfWeightMap = zhzsWeightService.getWeightMapByPrimaAndSecon("行政处罚", hj);
List<DaPingScoreQX> xzcfScoreByYi = getPrimaryAndQuScore(xzcfVo, xzcfWeightMap);
log.info("行政处罚计算合格");
//抽查考核 hj like
List<ZHZSVo> cckhVo = cckhDataService.getScoreByQuQuery(hj, szqx, startTime, endTime);
String cckhHJ = hj;
if (Tools.isNotEmpty(hj)) {
if (hj.contains("销售")) {
cckhHJ = "食品销售";
} else if (hj.contains("餐饮")) {
cckhHJ = "餐饮服务";
} else if (hj.contains("生产")) {
cckhHJ = "食品生产";
}
}
@ -408,12 +575,12 @@ public class ZhzsServiceImpl implements ZhzsService {
//抽查考核 hj like
List<ZHZSVo> cckhVo = cckhDataService.getScoreByStreetQuery(hj, szqx, startTime, endTime);
String cckhHJ = hj;
if (Tools.isNotEmpty(hj)){
if (hj.contains("销售")){
if (Tools.isNotEmpty(hj)) {
if (hj.contains("销售")) {
cckhHJ = "食品销售";
}else if (hj.contains("餐饮")){
} else if (hj.contains("餐饮")) {
cckhHJ = "餐饮服务";
}else if (hj.contains("生产")){
} else if (hj.contains("生产")) {
cckhHJ = "食品生产";
}
}
@ -958,13 +1125,29 @@ public class ZhzsServiceImpl implements ZhzsService {
}
}
@Override
public void initZhzsAllSteetDasai() {
String hj = null;
String szqx = "奉贤区";
LocalDateTime now = LocalDateTime.now();
for (String street : streetListInit) {
for (int month = 1; month <= 5; month++) {
String monthStr = month + "";
String yearStr = 2023 + "";
MonthTimeVo timeByMonth = TimeUtil.getTimeByMonth(yearStr, monthStr, monthStr, TimeUtil.FORMAT_1);
this.setZhzsAllFenzi(timeByMonth.getStartDataTime(), timeByMonth.getEndDataTime(), monthStr, szqx, street, hj, now);
}
//
}
}
@Override
public void testZhzsAllLv(String hj, String szqx, int month, int year) {
LocalDateTime now = LocalDateTime.now();
String monthStr = month + "";
String yearStr = year + "";
MonthTimeVo timeByMonth = TimeUtil.getTimeByMonth(yearStr, monthStr, monthStr, TimeUtil.FORMAT_1);
this.setZhzsAllLv(timeByMonth.getStartDataTime(), timeByMonth.getEndDataTime(), monthStr, szqx, hj, now);
}
@ -983,7 +1166,7 @@ public class ZhzsServiceImpl implements ZhzsService {
String year = startTime.getYear() + "";
//默认2023
//信息追溯 hj
ZhzsScoreVo<XinXiZhuiSuLv> xxzs = zcqyService.getZhuiSuLvVo(startTime, endTime, hj, szqx,"" );
ZhzsScoreVo<XinXiZhuiSuLv> xxzs = zcqyService.getZhuiSuLvVo(startTime, endTime, hj, szqx, "");
List<XinXiZhuiSuLv> xxzsAllLvList = xxzs.getAllLvList();
BigDecimal xxzsWeightScore = xxzs.getWeightScore();
BigDecimal xxzsWeightAdd = xxzs.getWeightAdd();
@ -1215,6 +1398,114 @@ public class ZhzsServiceImpl implements ZhzsService {
}
public void setZhzsAllFenzi(LocalDate startTime, LocalDate endTime, String month, String szqx, String street, String hj, LocalDateTime now) {
//三级指标是否加权
boolean isWeightedTertiary = false;
//二级指标是否加权
boolean isWeightedSecondary = true;
//三级指标是否加权
boolean isWeightedPrimary = false;
String year = startTime.getYear() + "";
//默认2023
//信息追溯 hj
ZhzsScoreVo<XinXiZhuiSuLv> xxzs = zcqyService.getZhuiSuLvVo(startTime, endTime, hj, szqx, street);
List<XinXiZhuiSuLv> xxzsAllLvList = xxzs.getAllLvList();
BigDecimal xxzsWeightScore = xxzs.getWeightScore();
BigDecimal xxzsWeightAdd = xxzs.getWeightAdd();
//行政处罚 hj + 环节
ZhzsScoreVo<XingZhengChuFaVo> xzcf = xzcfDataService.getFaShengLvVoStreet(startTime, endTime, hj, szqx, street);
List<XingZhengChuFaVo> xzcfAllLvList = xzcf.getAllLvList();
BigDecimal xzcfWeightScore = xzcf.getWeightScore();
BigDecimal xzcfWeightAdd = xzcf.getWeightAdd();
//抽检监测 hj + 环节 内部替换销售和流通
ZR<List<TongJiHeGeLv>> cjjc = cjjcService.getTongJiHeGeLvDaPingStreet(startTime, endTime, hj, szqx, street);
List<TongJiHeGeLv> cjjcAllLvList = cjjc.getData();
BigDecimal cjjcWeightScore = cjjc.getWeightScore();
BigDecimal cjjcWeightAdd = cjjc.getWeightAdd();
//抽查考核 hj like
ZhzsScoreVo<CCKHVo> cckh = cckhDataService.getKaoHeLvVo(startTime, endTime, hj, szqx);
List<CCKHVo> cckhAllLvList = cckh.getAllLvList();
BigDecimal cckhWeightScore = cckh.getWeightScore();
BigDecimal cckhWeightAdd = cckh.getWeightAdd();
//执法检查 hj + 环节
Map<String, Object> zfjc = (Map<String, Object>) zfjcService.getWenTiLvDaPingStreet(startTime, endTime, hj, szqx, street);
List<ZhiFaJianChaLv> zfjcAllLvList = (List<ZhiFaJianChaLv>) zfjc.get("data");
BigDecimal zfjcWeightScore = (BigDecimal) zfjc.get("weightScore");
BigDecimal zfjcWeightAdd = (BigDecimal) zfjc.get("weightAdd");
//投诉举报 hj
ZR<List<TouSuJuBaoLv>> tsjb = tsjbDataService.getTouSuLvDaPingStreet(startTime, endTime, hj, szqx, street);
List<TouSuJuBaoLv> tsjbAllLvList = tsjb.getData();
BigDecimal tsjbWeightScore = tsjb.getWeightScore();
BigDecimal tsjbWeightAdd = tsjb.getWeightAdd();
//综合性指标
ZhzsScoreVo<ZhxzbVo> zhxzb = getZhxzbAllVo(szqx, year);
List<ZhxzbVo> zhxzbLvList = zhxzb.getAllLvList();
BigDecimal zhxzbWeightScore = zhxzb.getWeightScore();
BigDecimal zhxzbWeightAdd = zhxzb.getWeightAdd();
if ("".equals(szqx)) {
szqx = "上海市";
}
ZhzsAllFenziDasai allScore = new ZhzsAllFenziDasai();
allScore.setAreaName(szqx);
allScore.setStreet(street);
allScore.setMonth(month);
allScore.setYear(year);
allScore.setUpdateTime(now);
//权重分数总和
BigDecimal addScore = xxzsWeightScore.add(xzcfWeightScore).add(cckhWeightScore).add(cjjcWeightScore)
.add(zfjcWeightScore).add(tsjbWeightScore).add(zhxzbWeightScore);
//权重总和
BigDecimal weightAdd = xxzsWeightAdd.add(xzcfWeightAdd).add(cckhWeightAdd).add(cjjcWeightAdd)
.add(zfjcWeightAdd).add(tsjbWeightAdd).add(zhxzbWeightAdd);
BigDecimal score = addScore.divide(weightAdd, 1, RoundingMode.HALF_UP);
//总分写入
allScore.setAllScore(score);
BigDecimal xxzsWeiduScore = xxzs.getWeiduScore();
BigDecimal xzcfWeiduScore = xzcf.getWeiduScore();
BigDecimal cjjcWeiduScore = cjjc.getWeiduScore();
BigDecimal cckhWeiduScore = cckh.getWeiduScore();
BigDecimal zfjcWeiduScore = (BigDecimal) zfjc.get("weiduScore");
BigDecimal tsjbWeiduScore = tsjb.getWeiduScore();
BigDecimal zhxzbWeiduScore = zhxzb.getWeiduScore();
//三级指标分数
// setZhzsScore(xxzsAllLvList, allScore);
// setZhzsScore(xzcfAllLvList, allScore);
setZhzsFenziCJJC(cjjcAllLvList, allScore);
// setZhzsScore(cckhAllLvList, allScore);
setZhzsFenziZFJC(zfjcAllLvList, allScore);
setZhzsFenziTSJB(tsjbAllLvList, allScore);
// setZhzsScore(zhxzbLvList, allScore);
allScore.setXxzs(xxzsWeiduScore);
allScore.setXzcf(xzcfWeiduScore);
allScore.setCjjc(cjjcWeiduScore);
allScore.setCckh(cckhWeiduScore);
allScore.setZfjc(zfjcWeiduScore);
allScore.setTsjb(tsjbWeiduScore);
allScore.setZhxzb(zhxzbWeiduScore);
//保留历史分数
zhzsDasaiService.save(allScore);
}
public static <T extends ZSScoreVo> void setZhzsLv(List<T> lvList, ZhzsAllLv zhzsalllv) {
// 获取 Class 对象
Class<?> cls = zhzsalllv.getClass();
@ -1255,6 +1546,79 @@ public class ZhzsServiceImpl implements ZhzsService {
});
}
/**
* 写入综合指数三级的分子 (投诉数)
*
* @param tsjbList
* @param zhzsAllScore
* @param <T>
*/
public static <T extends ZSScoreVo> void setZhzsFenziTSJB(List<TouSuJuBaoLv> tsjbList, ZhzsAllFenziDasai zhzsAllScore) {
// 获取 Class 对象
Class<?> cls = zhzsAllScore.getClass();
tsjbList.stream().forEach(lv -> {
try {
log.debug(lv.getWeightKey());
ZhzsLvEnum nowLv = ZhzsLvEnum.getLvByPinName(lv.getWeightKey());
// 获取属性字段
Field field = cls.getField(nowLv.entityName);
// 给属性赋值
field.set(zhzsAllScore, BigDecimal.valueOf(lv.getTOUSUSHU()));
} catch (Exception e) {
throw new RuntimeException(e);
}
});
}
/**
* 写入综合指数三级的分子 (问题数)
*
* @param lvList
* @param zhzsAllScore
* @param <T>
*/
public static <T extends ZSScoreVo> void setZhzsFenziZFJC(List<ZhiFaJianChaLv> lvList, ZhzsAllFenziDasai zhzsAllScore) {
// 获取 Class 对象
Class<?> cls = zhzsAllScore.getClass();
lvList.stream().forEach(lv -> {
try {
log.debug(lv.getWeightKey());
ZhzsLvEnum nowLv = ZhzsLvEnum.getLvByPinName(lv.getWeightKey());
// 获取属性字段
Field field = cls.getField(nowLv.entityName);
// 给属性赋值
field.set(zhzsAllScore, BigDecimal.valueOf(lv.getWENTISHU()));
} catch (Exception e) {
throw new RuntimeException(e);
}
});
}
/**
* 写入综合指数三级的分子 (问题数)
*
* @param lvList
* @param zhzsAllScore
* @param <T>
*/
public static <T extends ZSScoreVo> void setZhzsFenziCJJC(List<TongJiHeGeLv> lvList, ZhzsAllFenziDasai zhzsAllScore) {
// 获取 Class 对象
Class<?> cls = zhzsAllScore.getClass();
lvList.stream().forEach(lv -> {
try {
log.info(lv.getWeightKey());
ZhzsLvEnum nowLv = ZhzsLvEnum.getLvByPinName(lv.getWeightKey());
// 获取属性字段
Field field = cls.getField(nowLv.entityName);
// 给属性赋值
field.set(zhzsAllScore, BigDecimal.valueOf(lv.getBUHEGEJIANSHU()));
} catch (Exception e) {
throw new RuntimeException(e);
}
});
}
/**
* 写入综合指数三级指标加权成绩
*

View File

@ -36,13 +36,19 @@ public class ZR<T> implements Serializable {
private BigDecimal score;
/**
* 权重分数
* 当前维度的分数 权重为当前维度权重和 1/7 一般85分
*/
@ApiModelProperty("维度分数")
private BigDecimal weiduScore;
/**
* 当前维度三级权重分的和 权重满为1 一般 15分 可能有bug
*/
@ApiModelProperty("权重分数")
private BigDecimal weightScore;
/**
* 权重总和
* 当前维度的条件下的权重总和 一般 0.15
*/
@ApiModelProperty("权重总和")
private BigDecimal weightAdd;
@ -52,6 +58,7 @@ public class ZR<T> implements Serializable {
r.data = data;
r.code = 0;
r.score = score;
r.weiduScore = score;
r.msg = "success";
return r;
}
@ -61,6 +68,7 @@ public class ZR<T> implements Serializable {
r.data = data;
r.code = 0;
r.score = score;
r.weiduScore = score;
r.weightScore = weightScore;
r.weightAdd = weightAdd;
r.msg = "success";

View File

@ -11,22 +11,20 @@ spring:
strict: false
datasource:
db1:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/buliang?characterEncoding=utf-8&useSSL=false
username: root
password: root
url: jdbc:dm://localhost:5236?clobAsString=true
username: BL
password: asd159159
driver-class-name: dm.jdbc.driver.DmDriver
# db2:
# url: jdbc:clickhouse://192.168.1.128:8123
# username: default
# password: ""
# driver-class-name: com.clickhouse.jdbc.ClickHouseDriver
db2:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/buliang?characterEncoding=utf-8&useSSL=false
username: root
password: root
url: jdbc:clickhouse://192.168.1.128:8124
username: default
password: default
driver-class-name: com.clickhouse.jdbc.ClickHouseDriver
hikari:
connection-timeout: 120000
jackson:

View File

@ -374,6 +374,78 @@
$scope.DasaiCache = function () {
dasaiFetchData();
}
$scope.DasaiMonths = ['', 3, 4, 5]
$scope.DasaiStreet = ["",
"庄行镇", "金汇镇", "柘林镇", "上海市奉贤区海湾旅游区",
// "青村镇",
// "西渡街道", "四团镇",
// // "金海街道",
// "奉浦街道",
// // "南桥镇",
// "海湾镇", "奉城镇"
// ,"上海海港综合经济开发区"
]
$scope.DasaiLittlemonth = [-1,1,2,0
]
async function dasaiFetchData() {
for (let i = 0; i < $scope.DaPingMonths.length; i++) {
for (let j = 0; j < $scope.DaPingSzqx.length; j++) {
for (let k = 0; k < $scope.DaPingHj.length; k++) {
await $http.get(Gaddress + '/ZHZS/GetScoreNewStreetAndShanghaiDasai?szqx=' + $scope.Dasaitreet[i] + '&month='
+ $scope.DasaiMonths[k] + '&szqx=' + $scope.DaPingSzqx[j]);
await $http.get(Gaddress + '/XZCF/GetFaShengLvDaPing?month=' + $scope.DaPingMonths[i] + '&hj='
+ $scope.DaPingHj[k] + '&szqx=' + $scope.DaPingSzqx[j]);
await $http.get(Gaddress + '/CCKH/GetKaoHeDaPing?month=' + $scope.DaPingMonths[i] + '&hj='
+ $scope.DaPingHj[k] + '&szqx=' + $scope.DaPingSzqx[j]);
await $http.get(Gaddress + '/TSJB/GetTouSuLvDaPing?month=' + $scope.DaPingMonths[i] + '&hj='
+ $scope.DaPingHj[k] + '&szqx=' + $scope.DaPingSzqx[j]);
await $http.get(Gaddress + '/XXZS/GetZhuiSuDaPing?month=' + $scope.DaPingMonths[i] + '&hj='
+ $scope.DaPingHj[k] + '&szqx=' + $scope.DaPingSzqx[j]);
await $http.get(Gaddress + '/ZFJC/GetWenTiLvDaPing?month=' + $scope.DaPingMonths[i] + '&hj='
+ $scope.DaPingHj[k] + '&szqx=' + $scope.DaPingSzqx[j]);
await $http.get(Gaddress + '/ZHZS/GetTitleScore?month=' + $scope.DaPingMonths[i] + '&hj='
+ $scope.DaPingHj[k] + '&szqx=' + $scope.DaPingSzqx[j]);
debugger;
}
}
}
for (let i = 0; i < $scope.DaPingMonths.length; i++) {
await $http.get(Gaddress + '/ZHZS/GetZHScoreDaPing?szqx=' + $scope.DaPingSzqx[i]);
}
for (let i = 0; i < $scope.DaPingMonths.length; i++) {
for (let k = 0; k < $scope.DaPingHj.length; k++) {
await $http.get(Gaddress + '/ZHZS/GetScoreNew?month=' + $scope.DaPingMonths[i] + '&hj='
+ $scope.DaPingHj[k]);
}
}
for (let i = 0; i < $scope.DaPingMonths.length; i++) {
for (let j = 0; j < $scope.DaPingSzqx.length; j++) {
await $http.get(Gaddress + '/CJJC/GetScoreByHuanJie?month=' + $scope.DaPingMonths[i]
+ '&szqx=' + $scope.DaPingSzqx[j]);
await $http.get(Gaddress + '/CCKH/GetScoreByHuanJie?month=' + $scope.DaPingMonths[i]
+ '&szqx=' + $scope.DaPingSzqx[j]);
await $http.get(Gaddress + '/XZCF/GetScoreByHuanJie?month=' + $scope.DaPingMonths[i]
+ '&szqx=' + $scope.DaPingSzqx[j]);
await $http.get(Gaddress + '/TSJB/GetScoreByHuanJie?month=' + $scope.DaPingMonths[i]
+ '&szqx=' + $scope.DaPingSzqx[j]);
await $http.get(Gaddress + '/XXZS/GetScoreByHuanJie?month=' + $scope.DaPingMonths[i]
+ '&szqx=' + $scope.DaPingSzqx[j]);
await $http.get(Gaddress + '/ZFJC/GetScoreByHuanJie?month=' + $scope.DaPingMonths[i]
+ '&szqx=' + $scope.DaPingSzqx[j]);
}
}
}
//读取系统缓存
$scope.SearchCache = function () {
//var curCacheName = $scope.selectedYear + '-' + $scope.selectedMonth;
@ -1208,17 +1280,17 @@
$scope.isShow = false;
//增加日志20211109
addlog("首页预警", "查询[首页预警]")
addlog("首页预警", "查询[首页预警]")
var nowDate2 = new Date();
var fullYear2 = nowDate2.getFullYear();
var month2 = nowDate2.getMonth() + 1;
var nowDate2 = new Date();
var fullYear2 = nowDate2.getFullYear();
var month2 = nowDate2.getMonth() + 1;
$("#tatol").html(fullYear2 + "年");
$("#month").html(month2 + "月");
$("#tatol").html(fullYear2 + "年");
$("#month").html(month2 + "月");
//弹框详细
$scope.model_click = function (a, b) {
$scope.model_click = function (a, b) {
if (b == 1) {
@ -1285,12 +1357,12 @@ $scope.model_click = function (a, b) {
})
}
}
$scope.showStatus = 0;
$scope.status = 1;
$scope.showStatus = 0;
$scope.status = 1;
//获取总数居
$scope.datashow2 = function (a) {
$scope.datashow2 = function (a) {
$scope.isShow = true; //显示加载提示
console.log('月份数据?', a)
$http.get(Gaddress + '/home/YJ_total2?a=' + a, {}).success(function (mydata) {
@ -1299,10 +1371,10 @@ $scope.datashow2 = function (a) {
$scope.isShow = false;
}, 1000)
})
}
}
//$scope.datashow2(0);
$scope.mothStatus = 0;
$scope.show = function (b, a, c) {
$scope.mothStatus = 0;
$scope.show = function (b, a, c) {
$("#back2").show();
if (a == 1) {
@ -1324,12 +1396,12 @@ $scope.show = function (b, a, c) {
$scope.SearchCache();
//console.log(b, a,c);
}
}
var aaa = 0;
var aaa = 0;
$scope.YJ_ALL = function (a, b, c) {
$scope.YJ_ALL = function (a, b, c) {
$("#back").show();
$scope.num = 12;
aaa = a;
@ -1443,49 +1515,49 @@ $scope.YJ_ALL = function (a, b, c) {
$scope.num2 = 2;
}
}
}
$("#back").hide();
$scope.back = function () {
$("#back").hide();
$scope.back = function () {
$("#back").hide();
$scope.num = aaa;
}
$("#back2").hide();
$scope.back2 = function () {
}
$("#back2").hide();
$scope.back2 = function () {
$("#back2").hide();
$scope.showStatus = 0;
$scope.mothStatus = 0;
$scope.datashow2(0);
}
}
//时间格式
function HandelTime(strTime) {
function HandelTime(strTime) {
var obj = new Date(parseInt(strTime.replace("/Date(", "").replace(")/", ""), 10));
return obj.getFullYear() + "-" + (obj.getMonth() + 1) + "-" + obj.getDate();
}
}
//时间格式
function add0(m) {
function add0(m) {
return m < 10 ? '0' + m : m
}
}
function format(shijianchuo) {
function format(shijianchuo) {
//shijianchuo是整数否则要parseInt转换
var time = new Date(shijianchuo);
var y = time.getFullYear();
var m = time.getMonth() + 1;
var d = time.getDate();
return y + '/' + add0(m) + '/' + add0(d);// + ' ' + add0(h) + ':' + add0(mm) + ':' + add0(s);
}
}
$scope.beginTime = new Date();
$scope.endTime = new Date();
$scope.beginTime = new Date();
$scope.endTime = new Date();
$scope.monthDa = 0;//选择月份
$scope.monthDa = 0;//选择月份
//根据月份查询数据
$scope.monthData = function (a, b) {
$scope.monthData = function (a, b) {
//console.log(a, b);
//$("#myModal").modal("show");
$scope.monthDa = a;
@ -1657,9 +1729,9 @@ $scope.monthData = function (a, b) {
})
}
}
}
$scope.monthDataA = function (a, b) {
$scope.monthDataA = function (a, b) {
var nn = $scope.num;
$scope.num = 12;
$scope.totalALL = [];
@ -1751,11 +1823,11 @@ $scope.monthDataA = function (a, b) {
$scope.totalALL = dT;
})
}
}
}
//所有预警的注释
var showData = [
var showData = [
{
text: "&nbsp;&nbsp;&nbsp;&nbsp;首次不合格预警指的是食品小类中某个检验项目在一段时间内首次出现不合格,根据预警需要食品类别可以切换为食品品种、食品亚类、食品大类。<br />&nbsp;&nbsp;&nbsp;&nbsp;预警分为3个等级<br />&nbsp;&nbsp;&nbsp;&nbsp;1. 半年内首次出现不合格预警为黄色<br />&nbsp;&nbsp;&nbsp;&nbsp;2. 1年内首次出现不合格预警为橙色<br />&nbsp;&nbsp;&nbsp;&nbsp;3. 在2年内首次出现不合格预警为红色"
},
@ -1789,13 +1861,13 @@ var showData = [
{
text: "&nbsp;&nbsp;&nbsp;&nbsp;污染物总膳食暴露量预警指的不同食品小类中某个检验项目的平均暴露量之和,污染物膳食平均暴露量=食品中某个检验项目的检测值的平均值*上海市居民该类食物消费量的平均值/上海市居民的平均体重污染物总膳食暴露量EXP和该项目的健康指导值进行比较同时考虑到有些检验项目的致癌性对于这类项目采用MOE方法进行计算计算公式为MOE=基准下限剂量BMDL/EXPMOE和10000进行比较小于等于10000存在风险大于10000说明健康风险不大。<br />&nbsp;&nbsp;&nbsp;&nbsp;预警分为3个等级<br />&nbsp;&nbsp;&nbsp;&nbsp;1. EXP占健康指导值的比值为50%到100%(不含)的预警为黄色<br />&nbsp;&nbsp;&nbsp;&nbsp;2. EXP占健康指导值的比值为100%到200%(不含)的预警为橙色<br />&nbsp;&nbsp;&nbsp;&nbsp;3. EXP占健康指导值的比值为大于200%、MOE小于等于10000的预警为红色"
}
]
]
$scope.show_text = 1;
$scope.show_text = 1;
//定义显示
$scope.showText = function (a, b) {
$scope.showText = function (a, b) {
console.log(b);
$scope.show_text = 2;
@ -1839,34 +1911,34 @@ $scope.showText = function (a, b) {
}
}
}
}
//定义隐藏
$scope.showTextEsc = function () {
$scope.showTextEsc = function () {
$scope.show_text = 1;
}
}
$scope.ii = 0;
$scope.ii = 0;
//导出
$scope.excel = function () {
$scope.excel = function () {
var i = $scope.ii;
//console.log(i);
window.location.href = Gaddress + "/home/Download?i=" + i;
}
}
//不合格率上升预警 月份计算
var numTime = new Date();
$scope.oneNum = getMonthDay(0);
$scope.twoNum = getMonthDay(1);
$scope.threeNum = getMonthDay(2);
$scope.fourNum = getMonthDay(3);
$scope.fiveNum = getMonthDay(4);
var numTime = new Date();
$scope.oneNum = getMonthDay(0);
$scope.twoNum = getMonthDay(1);
$scope.threeNum = getMonthDay(2);
$scope.fourNum = getMonthDay(3);
$scope.fiveNum = getMonthDay(4);
//计算月份
function getMonthDay(n) {
function getMonthDay(n) {
var nowDate = new Date();
var year = nowDate.getFullYear();
var month = nowDate.getMonth();
@ -1876,7 +1948,7 @@ function getMonthDay(n) {
year = year - 1;
}
return month;
}
}
}])
}])

View File

@ -131,6 +131,8 @@
<button class="btn-warning" ng-click="SearchCache()">缓存搜索</button>
<button class="btn-warning" ng-click="DapingCache()" ng-disabled="isLoadCache">大屏缓存</button>
<button class="btn-warning" ng-click="DasaiCache()" ng-disabled="isLoadCache">大赛缓存</button>
<!--<button class="btn-success" ng-click="test1(1)">操作测试</button>-->
<!--<button class="btn-warning" ng-click="TestData()">测试数据加载</button>-->
<!--<button class="btn-warning" ng-click="DisplayDetailZiLei('SFYJ')">首发预警</button>