Commit 460ad716 by wangxing

Merge remote-tracking branch 'remotes/origin/master' into dev_neimeng

parents 0e843dea 6aa194b7
......@@ -144,6 +144,11 @@
<artifactId>commons-pool2</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.8</version>
</dependency>
<!-- jedis 依赖包 -->
<dependency>
<groupId>org.springframework.data</groupId>
......
......@@ -12,7 +12,6 @@ import com.cc.utils.CodeUtils;
import com.cc.utils.CommonFunc;
import com.cc.utils.EasyUIPage;
import com.cc.utils.Utils;
import com.ctc.wstx.util.StringUtil;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
......
package com.mis.controller;
import com.mis.model.SysDictitem;
import com.cc.utils.CodeUtils;
import com.cc.utils.EasyUIPage;
import com.mis.service.IAsjxxService;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
public class AsjxxController {
@Autowired
IAsjxxService asjxxService1;
private static final Logger logger = LoggerFactory.getLogger(AsjxxController.class);
@RequestMapping(value = "/ssjzqk",method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody public List<Map<String, Object>> ssjzqk(HttpServletRequest request, @RequestParam(required = false) String asjfskssj,@RequestParam(required = false) String asjfsjssj,@RequestParam(required = false) String gajgdm, String unitcode, String userGrade) {
List<Map<String, Object>> ssjzqkList = new ArrayList<Map<String, Object>>();
String ladwdm = "";
String myCode = "";
int sublimeLength = 0;
// 点击某一地点显示
if (StringUtils.isNotEmpty(gajgdm)) {
Map<String,Object> ladwMap = CodeUtils.getLadwAndMyCodeByGajgdm(gajgdm);
ladwdm = (String) ladwMap.get("ladwdm");
myCode = (String) ladwMap.get("code");
sublimeLength = (Integer) ladwMap.get("sublimeLength");
} else {
// 系统默认登录进来显示
Map<String,Object> ladwMap = CodeUtils.getLadwAndMyCode(unitcode, userGrade);
ladwdm = (String) ladwMap.get("ladwdm");
myCode = (String) ladwMap.get("code");
}
String page = request.getParameter("page");
String rows = request.getParameter("rows");
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(Integer.parseInt(page));
easyUIPage.setPagePara(Integer.parseInt(rows));
String pid = CodeUtils.formatString(ladwdm,12);
List<SysDictitem> dictItemList = new ArrayList();
if(myCode.startsWith("14")&&myCode.endsWith("__0000")){
//为了兼容山西部分派出所单位代码包含“99”的情况 山西县级查询下属单位,按照pid区查询
//dictItemList.addAll(dicItemService.getAllZzjgxx(CodeUtils.formatString(ladwdm,12),null));//查询本单位信息
//dictItemList.addAll(dicItemService.getAllZzjgxx(null,pid)); //查询下属单位信息
}else{
//dictItemList = dicItemService.getAllZzjgxx(myCode,null);//所有辖区单位
}
if (dictItemList != null && dictItemList.size() > 0) {
// 海南省直属县地区
if (("S".equals(userGrade) || "T".equals(userGrade)) && StringUtils.isEmpty(gajgdm)) {
String ssdw = unitcode.substring(0,2);
// title
if (ssdw != null && ssdw.length() > 3) {
if (ssdw.indexOf("46") == 0) {// 省级判断
//List<SysDictitem> dictItemList4690 = dicItemService.getAllZzjgxx("4690__000000","460000000000");
//dictItemList.addAll(dictItemList4690);
}
}
}
Map<String,Object> map = asjxxService1.getSsjzqk(ladwdm,asjfskssj,asjfsjssj);
for (int i = 0; i <= dictItemList.size(); i++) {
SysDictitem dictItem = null;
String code = null;
String name = null;
String ladwdm1 = null;
if(i < dictItemList.size() ){
dictItem = dictItemList.get(i);
code = dictItem.getCode();
name = dictItem.getName();
if (StringUtils.isNotEmpty(gajgdm)) {//钻入
ladwdm1 = code.substring(0, sublimeLength);
}else{
//ladwdm1 = CodeUtils.getLadwNext(unitcode,userGrade, dictItem);
}
if(code.startsWith("14")&&code.substring(6, 8).equals("99")){//山西派出所特殊判断
ladwdm1 = code.substring(0,10);
}
}
if (!"469000000000".equals(code)) {
double ssjzrmbyTotal = 0;// 损失价值
double sjcwjzrmbyTotal = 0;// 收缴价值
int asjswrsTotal = 0;// 死亡人数
int asjssrsTotal = 0;// 受伤人数
if(i== dictItemList.size()){
BigDecimal ssjzrmby =(BigDecimal)map.get("SSJZRMBY");
BigDecimal sjcwjzrmby =(BigDecimal)map.get("SJCWJZRMBY");
BigDecimal asjswry_rs =(BigDecimal)map.get("ASJSWRY_RS");
BigDecimal asjssry_rs =(BigDecimal)map.get("ASJSSRY_RS");
ssjzrmbyTotal = ssjzrmby.doubleValue();
sjcwjzrmbyTotal = sjcwjzrmby.doubleValue();
asjswrsTotal = asjswry_rs.intValue();
asjssrsTotal = asjssry_rs.intValue();
name = "合计";
code = null;
}else{
Map<String,Object> map1 = asjxxService1.getSsjzqk(ladwdm1,asjfskssj,asjfsjssj);
BigDecimal ssjzrmby =(BigDecimal)map1.get("SSJZRMBY");
BigDecimal sjcwjzrmby =(BigDecimal)map1.get("SJCWJZRMBY");
BigDecimal asjswry_rs =(BigDecimal)map1.get("ASJSWRY_RS");
BigDecimal asjssry_rs =(BigDecimal)map1.get("ASJSSRY_RS");
ssjzrmbyTotal = ssjzrmby.doubleValue();
sjcwjzrmbyTotal = sjcwjzrmby.doubleValue();
asjswrsTotal = asjswry_rs.intValue();
asjssrsTotal = asjssry_rs.intValue();
}
Map<String, Object> fapaMaps = new HashMap<String, Object>();
fapaMaps.put("name", name);
fapaMaps.put("ssjzrmbyTotal", ssjzrmbyTotal);
fapaMaps.put("sjcwjzrmbyTotal", sjcwjzrmbyTotal);
fapaMaps.put("asjswrsTotal", asjswrsTotal);
fapaMaps.put("asjssrsTotal", asjssrsTotal);
fapaMaps.put("code", code);
ssjzqkList.add(fapaMaps);
}
}
}
return ssjzqkList;
}
}
package com.mis.dao;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import java.util.Map;
@Component
@Mapper
public interface AsjxxDao1 {
Map<String,Object> getSsjzqk(Map<String, String> map);
}
This source diff could not be displayed because it is too large. You can view the blob instead.
package com.mis.model;
import java.util.Date;
public class SysDictitem {
private String code = null;
private String name = null;
private String groupid = null;
private String pid = null;
private String spell = null;
private String wbzx = null;
private String simple = null;
private String groupname = null;
private Date lrsj = null;
private Date lrsj1 = null;
private int xxdlNum = 0;
private String id;
private String codeStr;
private String levelid;
private String yycj1;
private String yycj2;
private String yycj3;
private String yycj4;
private String isparent;
private String yycj7;
private String yycj5;
private String yycj6;
private String description;
private String endcode;
private String startcode;
private String yycj8;
private String sfqybmpdbz;
private String dmmcbm;
private String gabxf;
private long scbz;
private String lrr;
private String yycj9;
public int getXxdlNum() {
return xxdlNum;
}
public void setXxdlNum(int xxdlNum) {
this.xxdlNum = xxdlNum;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getGroupid() {
return groupid;
}
public void setGroupid(String groupid) {
this.groupid = groupid;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getSpell() {
return spell;
}
public void setSpell(String spell) {
this.spell = spell;
}
public String getWbzx() {
return wbzx;
}
public void setWbzx(String wbzx) {
this.wbzx = wbzx;
}
public String getSimple() {
return simple;
}
public void setSimple(String simple) {
this.simple = simple;
}
public String getGroupname() {
return groupname;
}
public void setGroupname(String groupname) {
this.groupname = groupname;
}
public Date getLrsj() {
return lrsj;
}
public void setLrsj(Date lrsj) {
this.lrsj = lrsj;
}
public Date getLrsj1() {
return lrsj1;
}
public void setLrsj1(Date lrsj1) {
this.lrsj1 = lrsj1;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCodeStr() {
return codeStr;
}
public void setCodeStr(String codeStr) {
this.codeStr = codeStr;
}
public String getLevelid() {
return levelid;
}
public void setLevelid(String levelid) {
this.levelid = levelid;
}
public String getYycj1() {
return yycj1;
}
public void setYycj1(String yycj1) {
this.yycj1 = yycj1;
}
public String getYycj2() {
return yycj2;
}
public void setYycj2(String yycj2) {
this.yycj2 = yycj2;
}
public String getYycj3() {
return yycj3;
}
public void setYycj3(String yycj3) {
this.yycj3 = yycj3;
}
public String getYycj4() {
return yycj4;
}
public void setYycj4(String yycj4) {
this.yycj4 = yycj4;
}
public String getIsparent() {
return isparent;
}
public void setIsparent(String isparent) {
this.isparent = isparent;
}
public String getYycj7() {
return yycj7;
}
public void setYycj7(String yycj7) {
this.yycj7 = yycj7;
}
public String getYycj5() {
return yycj5;
}
public void setYycj5(String yycj5) {
this.yycj5 = yycj5;
}
public String getYycj6() {
return yycj6;
}
public void setYycj6(String yycj6) {
this.yycj6 = yycj6;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getEndcode() {
return endcode;
}
public void setEndcode(String endcode) {
this.endcode = endcode;
}
public String getStartcode() {
return startcode;
}
public void setStartcode(String startcode) {
this.startcode = startcode;
}
public String getYycj8() {
return yycj8;
}
public void setYycj8(String yycj8) {
this.yycj8 = yycj8;
}
public String getSfqybmpdbz() {
return sfqybmpdbz;
}
public void setSfqybmpdbz(String sfqybmpdbz) {
this.sfqybmpdbz = sfqybmpdbz;
}
public String getDmmcbm() {
return dmmcbm;
}
public void setDmmcbm(String dmmcbm) {
this.dmmcbm = dmmcbm;
}
public String getGabxf() {
return gabxf;
}
public void setGabxf(String gabxf) {
this.gabxf = gabxf;
}
public long getScbz() {
return scbz;
}
public void setScbz(long scbz) {
this.scbz = scbz;
}
public String getLrr() {
return lrr;
}
public void setLrr(String lrr) {
this.lrr = lrr;
}
public String getYycj9() {
return yycj9;
}
public void setYycj9(String yycj9) {
this.yycj9 = yycj9;
}
}
\ No newline at end of file
package com.mis.service;
import java.util.Map;
public interface IAsjxxService {
public Map<String,Object> getSsjzqk(String ladwdm, String asjfskssj, String asjfsjssj);
}
package com.mis.service.impl;
import com.mis.dao.AsjxxDao1;
import com.mis.service.IAsjxxService;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
@Service("asjxxService1")
public class AsjxxServiceImpl implements IAsjxxService {
@Autowired
AsjxxDao1 asjxxDao1;
public Map<String,Object> getSsjzqk(String ladwdm ,String asjfskssj,String asjfsjssj){
Map<String,String> map = new HashedMap();
map.put("ladwdm",ladwdm);
map.put("asjfskssj",asjfskssj);
map.put("asjfsjssj",asjfsjssj);
return asjxxDao1.getSsjzqk(map);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<import resource="classpath*:spring-context.xml"/>
<import resource="classpath*:spring-context-mis.xml"/>
</beans>
\ No newline at end of file
......@@ -3,4 +3,11 @@
jdbc.driverClass=oracle.jdbc.driver.OracleDriver
jdbc.url=jdbc:oracle:thin:@127.0.0.1:1521:XZXT
jdbc.user=XZXT
jdbc.password=XZXT
\ No newline at end of file
jdbc.password=XZXT
#mis
jdbc.mis.driverClass=oracle.jdbc.driver.OracleDriver
jdbc.mis.url=jdbc:oracle:thin:@192.168.1.106:1521:ORCL
jdbc.mis.user=DBAUSERGAXZ
jdbc.mis.password=DBAUSERGAXZ
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mis.dao.AsjxxDao1">
<select id="getSsjzqk" parameterType="java.util.HashMap" resultType="java.util.HashMap">
SELECT nvl(SUM(SSJZRMBY),0) as ssjzrmby,nvl(SUM(SJCWJZRMBY),0) as sjcwjzrmby,nvl(SUM(ASJSWRY_RS),0) as asjswry_rs,nvl(SUM(ASJSSRY_RS),0) as asjssry_rs
FROM tb_st_asj t where t.xxsc_pdbz=0 and t.XXDJDW_GAJGJGDM like #{ladwdm}||'%'
<if test="asjfskssj != ''">
AND t.DJSJ <![CDATA[>=]]> to_date(#{asjfskssj},'yyyy-MM-dd')
</if>
<if test="asjfsjssj != ''">
AND t.DJSJ <![CDATA[<]]> to_date(#{asjfsjssj},'yyyy-MM-dd')+1
</if>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd" >
<configuration>
<!-- <settings>
&lt;!&ndash; 配置全局性 cache 的 ( 开 / 关) default:true &ndash;&gt;
<setting name="cacheEnabled" value="true"/>
&lt;!&ndash; 设置驱动等待数据响应的超时数 默认没有设置&ndash;&gt;
<setting name="defaultStatementTimeout" value="25000"/>
&lt;!&ndash; [是否 启用 数据中 A_column 自动映射 到 java类中驼峰命名的属性 default:fasle] &ndash;&gt;
<setting name="mapUnderscoreToCamelCase" value="false"/>
<setting name="proxyFactory" value="CGLIB"/>
<setting name="lazyLoadingEnabled" value="true"/>
</settings>
<plugins>
<plugin interceptor="com.github.pagehelper.PageHelper">
<property name="dialect" value="mysql"/>
&lt;!&ndash;该参数默认为flase&ndash;&gt;
&lt;!&ndash;设置为ture时,会将RowBounds第一个参数offset当成pageNum页面使用&ndash;&gt;
&lt;!&ndash;和startPage中的pageNum效果一样&ndash;&gt;
<property name="offsetAsPageNum" value="true"/>
&lt;!&ndash;该参数默认为flas&ndash;&gt;
&lt;!&ndash;设置为true时,使用RowBounds分页进行count查询&ndash;&gt;
<property name="rowBoundsWithCount" value="true"/>
&lt;!&ndash;设置为true时,如果pageSize=0或者RowBounds.limit=0就会查询出全部的结果&ndash;&gt;
&lt;!&ndash;(相当于没有执行分页查询,但是返回结果仍然是Page类型)&ndash;&gt;
<property name="pageSizeZero" value="true"/>
</plugin>
</plugins>-->
<settings>
<setting name="mapUnderscoreToCamelCase" value="true"/>
</settings>
<typeAliases>
<package name="com.mis.model"/>
</typeAliases>
<plugins>
<plugin interceptor="com.github.pagehelper.PageHelper">
<!--分页参数合理化 -->
<property name="reasonable" value="true"/>
</plugin>
</plugins>
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<!--Spring扫描包,除了controller-->
<context:component-scan base-package="com.mis.service"></context:component-scan>
<context:property-placeholder location="classpath:*.properties" />
<bean id="dataSource-mis" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${jdbc.mis.driverClass}"></property>
<property name="jdbcUrl" value="${jdbc.mis.url}"></property>
<property name="user" value="${jdbc.mis.user}"></property>
<property name="password" value="${jdbc.mis.password}"></property>
<property name="minPoolSize" value="1"></property>
<property name="maxPoolSize" value="100"></property>
<property name="initialPoolSize" value="10"></property>
<property name="acquireIncrement" value="1"></property>
</bean>
<!--================== 配置和MyBatis的整合=============== -->
<bean id="sqlSessionFactory-mis" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 指定mybatis全局配置文件的位置 -->
<property name="configLocation" value="classpath:mybatis-config-mis.xml"></property>
<property name="dataSource" ref="dataSource-mis"></property>
<!-- 指定mybatis,mapper文件的位置 -->
<property name="mapperLocations" value="classpath:mapper/mis/*.xml"></property>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.mis.dao"></property>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory-mis"></property>
</bean>
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory-mis"></constructor-arg>
<constructor-arg name="executorType" value="BATCH"></constructor-arg>
</bean>
<!-- ===============事务控制的配置 ================-->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<!--控制住数据源 -->
<property name="dataSource" ref="dataSource-mis"></property>
</bean>
<!--<import resource="redis-context.xml"/>-->
<aop:config>
<!-- 切入点表达式 -->
<aop:pointcut expression="execution(* com.mis.service..*(..))" id="txPoint"/>
<!-- 配置事务增强 -->
<aop:advisor advice-ref="txAdvice" pointcut-ref="txPoint"/>
</aop:config>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*"/>
<tx:method name="get*" read-only="true"/>
</tx:attributes>
</tx:advice>
</beans>
\ No newline at end of file
......@@ -24,10 +24,11 @@
<property name="configLocation" value="classpath:mybatis-config.xml"></property>
<property name="dataSource" ref="dataSource"></property>
<!-- 指定mybatis,mapper文件的位置 -->
<property name="mapperLocations" value="classpath:mapper/*.xml"></property>
<property name="mapperLocations" value="classpath:mapper/xzxt/*.xml"></property>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.cc.dao"></property>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
</bean>
......
......@@ -11,7 +11,7 @@
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-context.xml</param-value>
<param-value>classpath:applicationContext-all.xml</param-value>
</context-param>
<!--2.springmvc的前端控制器,拦截所有请求-->
<servlet>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment