增加用户积分自查

master
gsy 4 months ago
parent 2f3fefaf86
commit d1251c60c0

@ -16,9 +16,13 @@ public class ThreadPoolConfig {
@Bean("PertolCafeteriaFeeThreadPool") //线程池实例名,多个线程池配置需要声明,一个线程池可有可无
public Executor executorNormal() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(4);
executor.setMaxPoolSize(10);
executor.setQueueCapacity(10);
// executor.setCorePoolSize(40);
// executor.setMaxPoolSize(4000);
// executor.setQueueCapacity(40000);
// executor.setKeepAliveSeconds(60);
executor.setCorePoolSize(40);
executor.setMaxPoolSize(4000);
executor.setQueueCapacity(40000);
executor.setKeepAliveSeconds(60);
executor.setThreadNamePrefix("NORMAL--");
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());

@ -110,7 +110,7 @@ public class CafterController {
try {
cafterService.exportCafterPageListExcle(searchForm,response);
} catch (Exception e) {
logger.error("com.nmgs.controller.CafeController.exportCafterPageListExcle: 导出失败"+e);
logger.error("com.nmgs.controller.CafeController.exportCafterPageListExcle: 导出失败",e);
}
}

@ -0,0 +1,59 @@
package com.nmgs.controller;
import com.nmgs.annotation.MySysLog;
import com.nmgs.mapper.petrol.CafterMapper;
import com.nmgs.mapper.petrol.OperatorsMapper;
import com.nmgs.service.ICafterService;
import com.nmgs.service.ICheckService;
import com.nmgs.util.TokenUtil;
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.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping("/Check")
@CrossOrigin(origins = "*")
public class CheckController {
public static Logger logger = LoggerFactory.getLogger(CheckController.class);
@Autowired
private ICheckService checkService;
/**
*
*/
@PostMapping("/getCheckPage")
@ResponseBody
@MySysLog(modelName="查询积分检查情况",methodDesc = "查询积分检查情况",methodType = "post" )
public Object getCafterPage(@RequestBody Map<String, Object> params){
return checkService.getCheckPage(params);
}
@GetMapping("/exportCheckListExcle")
@ResponseBody
@MySysLog(modelName="导出积分检查数据Excel",methodDesc = "导出积分检查数据Excel",methodType = "GET" )
public void exportCheckListExcle(String searchForm, HttpServletResponse response){
logger.info("searchForm============"+searchForm.toString());
try {
checkService.exportCheckListExcle(searchForm,response);
} catch (Exception e) {
logger.error("com.nmgs.controller.CheckController.exportCheckListExcle: 导出失败",e);
}
}
}

@ -13,6 +13,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.List;
@ -95,7 +96,7 @@ public class ServiceAreaOperatorsController {
}
return resultMap;
} catch (Exception e) {
logger.error("com.nmgs.controller.OperatorsController.addOperators: 保存数据失败 "+e);
logger.error("com.nmgs.controller.OperatorsController.addOperators: 保存数据失败 ",e);
resultMap.put("msg","保存失败");
resultMap.put("data","");
resultMap.put("result",-1);
@ -126,7 +127,7 @@ public class ServiceAreaOperatorsController {
}
return resultMap;
} catch (Exception e) {
logger.error("com.nmgs.controller.OperatorsController.updateOperators: 修改数据失败 "+e);
logger.error("com.nmgs.controller.OperatorsController.updateOperators: 修改数据失败 ",e);
resultMap.put("msg","保存失败");
resultMap.put("data","");
resultMap.put("result",-1);
@ -153,7 +154,7 @@ public class ServiceAreaOperatorsController {
}
return resultMap;
} catch (Exception e) {
logger.error("com.nmgs.controller.OperatorsController.deleteOperators: 删除失败 "+e);
logger.error("com.nmgs.controller.OperatorsController.deleteOperators: 删除失败 ",e);
resultMap.put("msg","删除失败");
resultMap.put("data","");
resultMap.put("result",-1);
@ -214,4 +215,17 @@ public class ServiceAreaOperatorsController {
}
@GetMapping("/exportOperationListExcle")
@ResponseBody
@MySysLog(modelName="导出商户信息数据Excel",methodDesc = "导出商户信息数据Excel",methodType = "GET" )
public void exportOperationListExcle(String searchForm, HttpServletResponse response){
logger.info("searchForm============"+searchForm.toString());
try {
OperatorsService.exportOperationListExcle(searchForm,response);
} catch (Exception e) {
logger.error("com.nmgs.controller.OperatorsController.exportOperationListExcle: 导出失败",e);
}
}
}

@ -52,4 +52,11 @@ public class IntegralCheck {
private BigDecimal resttegraltionadd;
@TableField(value = "OPERTOR")
private String opertor;
@TableField(exist = false)
private String userRealName;
@TableField(exist = false)
private String isRight;
}

@ -148,7 +148,7 @@
integration_list_table list
left join platecolor_text color on color.VALUE = SUBSTR(list.ACARNO,INSTR(list.ACARNO,'_')+1)
<where>
and list.PAYTYPE in ('AM')
and list.PAYTYPE in ('AM','GREENBAK')
<!-- 统计日期(起始)查询条件 -->
<if test="params.classDateBeginQuery != null and params.classDateBeginQuery != ''">
<if test="params.DBTYPE == 1">
@ -195,7 +195,7 @@
integration_list_table list
left join platecolor_text color on color.VALUE = SUBSTR(list.ACARNO,INSTR(list.ACARNO,'_')+1)
<where>
and list.PAYTYPE in ('AM')
and list.PAYTYPE in ('AM','GREENBAK')
<!-- 统计日期(起始)查询条件 -->
<if test="params.classDateBeginQuery != null and params.classDateBeginQuery != ''">
<if test="params.DBTYPE == 1">
@ -246,7 +246,8 @@
sum(case when list.PAYTYPE = 'FG' then list.PAYINTEGRATION/100.00 else 0 end ) FGOTAL,
sum(case when list.PAYTYPE = 'FS' then list.PAYINTEGRATION/100.00 else 0 end ) FSOTAL,
sum(case when list.PAYTYPE = 'FCA' then list.PAYINTEGRATION/100.00 else 0 end ) FCAOTAL,
sum(case when list.PAYTYPE in ('AM') then list.PAYINTEGRATION/100.00 else 0 end ) MILETOTAL,
sum(case when list.PAYTYPE = 'GREENBAK' then list.PAYINTEGRATION/100.00 else 0 end ) GREENBAKCAOTAL,
sum(case when list.PAYTYPE in ('AM','GREENBAK') then list.PAYINTEGRATION/100.00 else 0 end ) MILETOTAL,
sum(case when list.PAYTYPE in ('TK') then list.PAYINTEGRATION/100.00 else 0 end ) TKTOTAL,
sum(case when list.PAYTYPE in ('AMT','AL','AME','AQE','AYE','AU','AT','AJ') then list.PAYINTEGRATION/100.00 else 0 end ) JIANGLITOTAL
from

@ -1272,7 +1272,7 @@
<select id="selectGantryIntegralTypeList" resultType="java.util.HashMap">
select VALUE,TEXT from PEYTYPE_TEXT where VALUE not like 'F%' and VALUE not like 'W%' and VALUE not like 'B%'
and VALUE not in ('AM','AP','AG','TK','AH','AS','AT','AU','RI','RAM','AL')
and VALUE not in ('AM','AP','AG','TK','AH','AS','AT','AU','RI','RAM','AL','GREENBAK')
</select>

@ -360,7 +360,7 @@
<select id="getVehicleIntegral" resultType="java.util.HashMap">
select COALESCE(sum(PAYINTEGRATION),0) as PAYINTEGRATION from INTEGRATION_LIST_TABLE list where list.ACARNO = #{params.ACARNO} and list.PAYTYPE = 'AM'
select COALESCE(sum(PAYINTEGRATION),0) as PAYINTEGRATION from INTEGRATION_LIST_TABLE list where list.ACARNO = #{params.ACARNO} and list.PAYTYPE in ('AM','GREENBAK')
</select>
<delete id="deleteData" >

@ -15,5 +15,13 @@ import java.util.Map;
@Mapper
public interface IntegralCheckMapper extends MppBaseMapper<IntegralCheck> {
/**
*
* @param page
* @param params
* @return
*/
Page<IntegralCheck> getCheckPage(Page<IntegralCheck> page, @Param("params") Map<String, Object> params);
}

@ -0,0 +1,63 @@
<?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.nmgs.mapper.petrol.IntegralCheckMapper">
<select id="getMaxId" resultType="java.lang.Integer">
SELECT MAX(ID) FROM cafter_table
</select>
<select id="getCheckPage" resultType="com.nmgs.entity.IntegralCheck">
select
ic.USERID,
ic.OPENID,
CONCAT(u.REALNAME,CONCAT(CONCAT('(',u.IDNUMBER),')')) as userRealName,
ic.CLASSDATE ,
ic.ENABLEINTEGRATION,
ic.OGINTEGRATION,
ic.CPINTEGRATION,
ic.RESTINTEGRALTIONBEFORE,
ic.OGINTEGRATIONBEFORE,
ic.CPINTEGRATIONBEFORE,
ic.RESTINTEGRALTIONDECODE,
ic.OGINTEGRATIONDECODE,
ic.CPINTEGRATIONDECODE,
ic.OGINTEGRATIONADD,
ic.CPINTEGRATIONADD,
ic.RESTTEGRALTIONADD,
OPERTOR
from INTEGRAL_CHECK ic
left join weixn_user_table u on ic.OPENID = u.OPENID
<where>
<!-- 统计日期(起始)查询条件 -->
<if test="params.startTime != null and params.startTime != ''">
<if test="params.DBTYPE == 1">
AND ic.CLASSDATE = dateadd(day,0,#{params.startTime})
</if>
<if test="params.DBTYPE == 2">
AND ic.CLASSDATE = TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
</if>
<if test="params.DBTYPE == 3">
AND ic.CLASSDATE = TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
</if>
<if test="params.DBTYPE == 4">
AND ic.CLASSDATE = STR_TO_DATE(#{params.startTime}, '%Y-%m-%d %H:%i:%s')
</if>
</if>
<!-- 用户姓名查询条件 -->
<if test="params.userRealNameQuery != null and params.userRealNameQuery != ''">
<bind name="userRealNameQuery" value="'%'+params.userRealNameQuery+'%'"/>
AND u.REALNAME LIKE #{userRealNameQuery}
</if>
<!-- 用户身份证查询条件 -->
<if test="params.userIdNumberQuery != null and params.userIdNumberQuery != ''">
AND u.IDNUMBER = #{params.userIdNumberQuery}
</if>
</where>
order by OPENID,OPERTOR
</select>
</mapper>

@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Select;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -136,16 +137,30 @@ public interface IntegrationListMapper extends MppBaseMapper<IntegrationList> {
*/
List<IntegrationList> getNewIntegralByUserid(@Param("params") Map<String,Object> params);
/**
* 退,
* 退, BMP
* @param params
* @return
*/
List<IntegrationList> getTotalIntegralByPeriod(@Param("params") Map<String,Object> params);
/**
* 退
* 退 BMP
* @param params
* @return
*/
List<IntegrationList> getTotalTKIntegralByPeriod(@Param("params") Map<String,Object> params);
/**
*
* @param paramYesterday
* @return
*/
List<IntegrationList> getUserIntegration(@Param("params") Map<String, Object> paramYesterday);
/**
*
* @param paramSum
* @return
*/
List<HashMap<String, Object>> getUserYesterdayAddIntegation(@Param("params") Map<String, Object> paramSum);
}

@ -148,7 +148,7 @@
integration_list_table list
left join platecolor_text color on color.VALUE = SUBSTR(list.ACARNO,INSTR(list.ACARNO,'_')+1)
<where>
and list.PAYTYPE in ('AM')
and list.PAYTYPE in ('AM','GREENBAK')
<!-- 统计日期(起始)查询条件 -->
<if test="params.classDateBeginQuery != null and params.classDateBeginQuery != ''">
<if test="params.DBTYPE == 1">
@ -195,7 +195,7 @@
integration_list_table list
left join platecolor_text color on color.VALUE = SUBSTR(list.ACARNO,INSTR(list.ACARNO,'_')+1)
<where>
and list.PAYTYPE in ('AM')
and list.PAYTYPE in ('AM','GREENBAK')
<!-- 统计日期(起始)查询条件 -->
<if test="params.classDateBeginQuery != null and params.classDateBeginQuery != ''">
<if test="params.DBTYPE == 1">
@ -246,6 +246,7 @@
sum(case when list.PAYTYPE = 'FG' then list.PAYINTEGRATION/100.00 else 0 end ) FGOTAL,
sum(case when list.PAYTYPE = 'FS' then list.PAYINTEGRATION/100.00 else 0 end ) FSOTAL,
sum(case when list.PAYTYPE = 'FCA' then list.PAYINTEGRATION/100.00 else 0 end ) FCAOTAL,
sum(case when list.PAYTYPE = 'GREENBAK' then list.PAYINTEGRATION/100.00 else 0 end ) GREENBAKCAOTAL,
sum(case when list.PAYTYPE in ('AM') then list.PAYINTEGRATION/100.00 else 0 end ) MILETOTAL,
sum(case when list.PAYTYPE in ('TK') then list.PAYINTEGRATION/100.00 else 0 end ) TKTOTAL,
sum(case when list.PAYTYPE in ('AMT','AL','AME','AQE','AYE','AU','AT','AJ') then list.PAYINTEGRATION/100.00 else 0 end ) JIANGLITOTAL
@ -758,6 +759,9 @@
</if>
group by iltt.payType
</select>
<!-- 获取用户截至某个时间点最新的积分流水 BMP -->
<select id="getNewIntegralByUserid" resultType="com.nmgs.entity.IntegrationList">
select
@ -801,4 +805,86 @@
)
</select>
<!-- 获取用户截至某个时间点最新的积分流水 GSY -->
<select id="getUserIntegration" resultType="com.nmgs.entity.IntegrationList">
select
PAYINTEGRATION,
RESTINTEGRATION ,
PAYTYPE ,
OGENABLEINTEGRATION ,
CPENABLEINTEGRATION
from
INTEGRATION_LIST_TABLE list
<where>
and USERID = #{params.userId}
<!-- 统计日期(终止)查询条件 -->
<if test="params.endTime != null and params.endTime != ''">
<if test="params.DBTYPE == 1">
and list.PAYTIME = (select max(PAYTIME) from INTEGRATION_LIST_TABLE where USERID = list.USERID and PAYTIME &lt; dateadd(day,0,#{params.endTime}))
</if>
<if test="params.DBTYPE == 2">
and list.PAYTIME = (select max(PAYTIME) from INTEGRATION_LIST_TABLE where USERID = list.USERID and PAYTIME &lt; TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS'))
</if>
<if test="params.DBTYPE == 3">
and list.PAYTIME = (select max(PAYTIME) from INTEGRATION_LIST_TABLE where USERID = list.USERID and PAYTIME &lt; TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS'))
</if>
<if test="params.DBTYPE == 4">
and list.PAYTIME = (select max(PAYTIME) from INTEGRATION_LIST_TABLE where USERID = list.USERID and PAYTIME &lt; STR_TO_DATE(#{params.endTime}, '%Y-%m-%d %H:%i:%s'))
</if>
</if>
</where>
order by RESTINTEGRATION desc
</select>
<!-- 获取用户截至某个时间点最新的积分流水 GSY -->
<select id="getUserYesterdayAddIntegation" resultType="java.util.HashMap">
select
COALESCE(sum(PAYINTEGRATION),0) as SUMPAYINTEGRATION
from INTEGRATION_LIST_TABLE list
left join WEIXN_USER_TABLE u on u.id = list.USERID
<where>
and list.USERID = #{params.userId}
and list.PAYTYPE not like 'F%' and list.PAYTYPE != 'TK'
<!-- 统计日期(起始)查询条件 -->
<if test="params.startTime != null and params.startTime != ''">
<if test="params.DBTYPE == 1">
AND list.PAYTIME >= dateadd(day,0,#{params.startTime})
</if>
<if test="params.DBTYPE == 2">
AND list.PAYTIME >= TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
</if>
<if test="params.DBTYPE == 3">
AND list.PAYTIME >= TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
</if>
<if test="params.DBTYPE == 4">
AND list.PAYTIME >= STR_TO_DATE(#{params.startTime}, '%Y-%m-%d %H:%i:%s')
</if>
</if>
<!-- 统计日期(终止)查询条件 -->
<if test="params.endTime != null and params.endTime != ''">
<if test="params.DBTYPE == 1">
AND list.PAYTIME &lt; dateadd(day,0,#{params.endTime})
</if>
<if test="params.DBTYPE == 2">
AND list.PAYTIME &lt; TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS')
</if>
<if test="params.DBTYPE == 3">
AND list.PAYTIME &lt; TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS')
</if>
<if test="params.DBTYPE == 4">
AND list.PAYTIME &lt; STR_TO_DATE(#{params.endTime}, '%Y-%m-%d %H:%i:%s')
</if>
</if>
</where>
</select>
</mapper>

@ -224,11 +224,17 @@ public interface UserMapper extends MppBaseMapper<User> {
List<Map<String, Object>> getRepeatUserIdData(HashMap<String, Object> params);
/**
*
* BMP
* @param params
* @return
*/
List<User> getUserByInteralList(@Param("params") Map<String, Object> params);
/**
* GSY
* @param paramUser GSY
* @return
*/
List<User> getHasIntegralChangeList(@Param("params") Map<String, Object> paramUser);
}

@ -1079,7 +1079,7 @@
</if>
</if>
</where>
order by we.PAYTIME,we.USERID
order by we.PAYTIME desc,we.USERID
</select>
<select id="getWaringDayMonth" parameterType="java.util.HashMap" resultType="java.util.HashMap" >
@ -1126,7 +1126,7 @@
</if>
</where>
GROUP BY we.USERID,u.REALNAME,we.DAY,we.PEYTYPE
order by we.DAY,we.USERID
order by we.DAY desc,we.USERID
</select>
@ -1212,6 +1212,11 @@
AND vs.extime &lt; STR_TO_DATE(#{params.endTime}, '%Y-%m-%d %H:%i:%s')
</if>
</if>
<!-- 是否免费车冲减 -->
<if test="params.rollBackQuery != null and params.rollBackQuery != ''">
AND CASE WHEN vs.ISCALLBACK IS NULL THEN 'N' ELSE 'Y' END = #{params.rollBackQuery}
</if>
</where>
order by vs.extime,vs.vehicleId
</select>
@ -1271,7 +1276,7 @@
<select id="selectGantryIntegralTypeList" resultType="java.util.HashMap">
select VALUE,TEXT from PEYTYPE_TEXT where VALUE not like 'F%' and VALUE not like 'W%' and VALUE not like 'B%'
and VALUE not in ('AM','AP','AG','TK','AH','AS','AT','AU','RI','RAM','AL')
and VALUE not in ('AM','GREENBAK','AP','AG','TK','AH','AS','AT','AU','RI','RAM','AL')
</select>
@ -1434,7 +1439,7 @@
</select>
<select id="getUserByInteralList" resultType="com.nmgs.entity.User" parameterType="java.util.HashMap">
select distinct t.ID as id,t.OPENID as openId from WEIXN_USER_TABLE t where t.certification=1 and exists(
select distinct t.ID as id,t.OPENID as openId from WEIXN_USER_TABLE t where t.certification not in (0,2,3) and exists(
select 1 from INTEGRATION_LIST_TABLE ilt where ilt.userid = t.ID
<if test="params.DBTYPE == 1">
@ -1463,6 +1468,45 @@
AND ilt.paytime &lt;= STR_TO_DATE(#{params.endTime}, '%Y-%m-%d %H:%i:%s')
</if>
)
</select>
<select id="getHasIntegralChangeList" resultType="com.nmgs.entity.User" parameterType="java.util.HashMap">
select
u.ID as ID,u.OPENID as OPENID
from INTEGRATION_LIST_TABLE list
left join WEIXN_USER_TABLE u on u.id = list.USERID
<where>
and u.CERTIFICATION not in (0,2,3)
<if test="params.DBTYPE == 1">
and list.paytime >=dateadd(day,0,#{params.startTime})
</if>
<if test="params.DBTYPE == 2">
and list.paytime >=TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
</if>
<if test="params.DBTYPE == 3">
and list.paytime >=TO_DATE(#{params.startTime}, 'SYYYY-MM-DD HH24:MI:SS')
</if>
<if test="params.DBTYPE == 4">
and list.paytime >=STR_TO_DATE(#{params.startTime}, '%Y-%m-%d %H:%i:%s')
</if>
<if test="params.DBTYPE == 1">
AND list.paytime &lt; dateadd(day,0,#{params.endTime})
</if>
<if test="params.DBTYPE == 2">
AND list.paytime &lt; TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS')
</if>
<if test="params.DBTYPE == 3">
AND list.paytime &lt; TO_DATE(#{params.endTime}, 'SYYYY-MM-DD HH24:MI:SS')
</if>
<if test="params.DBTYPE == 4">
AND list.paytime &lt; STR_TO_DATE(#{params.endTime}, '%Y-%m-%d %H:%i:%s')
</if>
</where>
GROUP BY u.ID,OPENID
</select>
</mapper>

@ -360,7 +360,7 @@
<select id="getVehicleIntegral" resultType="java.util.HashMap">
select COALESCE(sum(PAYINTEGRATION),0) as PAYINTEGRATION from INTEGRATION_LIST_TABLE list where list.ACARNO = #{params.ACARNO} and list.PAYTYPE = 'AM'
select COALESCE(sum(PAYINTEGRATION),0) as PAYINTEGRATION from INTEGRATION_LIST_TABLE list where list.ACARNO = #{params.ACARNO} and list.PAYTYPE in ('AM','GREENBAK')
</select>
<delete id="deleteData" >

@ -0,0 +1,14 @@
package com.nmgs.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nmgs.entity.IntegralCheck;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
public interface ICheckService {
Page<IntegralCheck> getCheckPage(Map<String, Object> params);
void exportCheckListExcle(String searchForm, HttpServletResponse response) throws Exception;
}

@ -4,6 +4,7 @@ package com.nmgs.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nmgs.entity.ServiceAreaOperators;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
@ -52,4 +53,6 @@ public interface IOperatorsService {
* @return
*/
ServiceAreaOperators login(Map<String, Object> params);
void exportOperationListExcle(String searchForm, HttpServletResponse response) throws Exception;
}

@ -1246,9 +1246,9 @@ public class AddServiceImpl implements IAddService {
if(null == userById){
continue;
}
if(userId.getCertification() == 5){
continue;
}
// if(userId.getCertification() == 5){
// continue;
// }
//获取用户累计增加的积分,用于判断用户的星级
BigDecimal totalAddIntegration = integrationListMapper.getTotalAddIntegrationByUserId(userById.getId());
if (null == totalAddIntegration) {
@ -1476,11 +1476,11 @@ public class AddServiceImpl implements IAddService {
//获取用户信息
User user = userMapper.getUserByIdLock((Integer) stringObjectMap.get("ID"));
if(PropertiesUtil.getValue("IsBak").equals("1")){
User userBak = userBakMapper.getUserByIdLock((Integer) stringObjectMap.get("ID"));
}
if(user.getCertification() == 5){
return null;
//User userBak = userBakMapper.getUserByIdLock((Integer) stringObjectMap.get("ID"));
}
// if(user.getCertification() == 5){
// return null;
// }
//获取用户累计增加的积分,用于判断用户的星级
BigDecimal totalAddIntegration = integrationListMapper.getTotalAddIntegrationByUserId(user.getId());
@ -1598,17 +1598,16 @@ public class AddServiceImpl implements IAddService {
@Transactional(timeout = 100)
public JSONObject saveATMScore(Map<String, Object> stringObjectMap, String startTime, String loginId) throws Exception {
log.info("stringObjectMap====="+stringObjectMap.toString());
JSONObject jSONObject = new JSONObject();
//获取用户信息
User user = userMapper.getUserByIdLock(((BigDecimal) stringObjectMap.get("ID")).intValue());
if(PropertiesUtil.getValue("IsBak").equals("1")){
User userBak = userBakMapper.getUserByIdLock(((BigDecimal) stringObjectMap.get("ID")).intValue());
}
if(user.getCertification() == 5){
return null;
//User userBak = userBakMapper.getUserByIdLock(((BigDecimal) stringObjectMap.get("ID")).intValue());
}
// if(user.getCertification() == 5){
// return null;
// }
//获取用户累计增加的积分,用于判断用户的星级
BigDecimal totalAddIntegration = integrationListMapper.getTotalAddIntegrationByUserId(user.getId());
if(null == totalAddIntegration){

@ -0,0 +1,418 @@
package com.nmgs.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nmgs.entity.Cafter;
import com.nmgs.entity.IntegralCheck;
import com.nmgs.entity.User;
import com.nmgs.mapper.petrol.CafterMapper;
import com.nmgs.mapper.petrol.IntegralCheckMapper;
import com.nmgs.mapper.petrol.PetrolMapper;
import com.nmgs.service.IAddService;
import com.nmgs.service.ICafterService;
import com.nmgs.service.ICheckService;
import com.nmgs.util.PropertiesUtil;
import org.apache.commons.codec.Charsets;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFColor;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
@Transactional(timeout = 100)
public class CheckServiceImpl implements ICheckService {
@Autowired
private IntegralCheckMapper integralCheckMapper;
public static Logger logger = LoggerFactory.getLogger(CheckServiceImpl.class);
@Override
public Page<IntegralCheck> getCheckPage(Map<String, Object> params) {
//从配置文件中读取数据库连接类型
params.put("DBTYPE", PropertiesUtil.getValue("DBType"));
//设置分页
Integer pageNum = (Integer) params.get("pageNum");
Integer pageSize = (Integer) params.get("pageSize");
Page<IntegralCheck> page = new Page<>(pageNum, pageSize);
page = integralCheckMapper.getCheckPage(page, params);
/**
* ENABLEINTEGRATION int 0 0 0 0 0 0 0 0 0 0 0 0 0 0
* OGINTEGRATION int 0 0 0 0 0 0 0 0 0 0 0 0 0 0
* CPINTEGRATION int 0 0 0 0 0 0 0 0 0 0 0 0 0 0
* RESTINTEGRALTIONBEFORE int 0 0 -1 0 0 0 0 0 0 0 0 0 0 0
* OGINTEGRATIONBEFORE int 0 0 -1 0 0 0 0 0 0 0 0 0 0 0
* CPINTEGRATIONBEFORE int 0 0 -1 0 0 0 0 0 0 0 0 0 0 0
* RESTINTEGRALTIONDECODE int 0 0 -1 0 0 0 0 0 0 0 0 0 0 0
* OGINTEGRATIONDECODE int 0 0 -1 0 0 0 0 0 0 0 0 0 0 0
* CPINTEGRATIONDECODE int 0 0 -1 0 0 0 0 0 0 0 0 0 0 0
* OGINTEGRATIONADD int 0 0 -1 0 0 0 0 0 0 0 0 0 0 0
* CPINTEGRATIONADD int 0 0 -1 0 0 0 0 0 0 0 0 0 0 0
* RESTTEGRALTIONADD int 0 0 -1 0 0 0 0 0 0 0 0 0 0 0
*/
//获取数据,判断用户积分是否正确,没有异常 01 0 23 2 45 4
List<IntegralCheck> records = page.getRecords();
List<IntegralCheck> newRecords = new ArrayList<>();
for(int i = 0 ; i < records.size();i=i+2){
IntegralCheck integralCheckNew = new IntegralCheck();
IntegralCheck integralCheckBMP = records.get(i);
IntegralCheck integralCheckGSY = records.get(i+1);
integralCheckNew.setEnableintegration(integralCheckGSY.getEnableintegration());
integralCheckNew.setOgintegration(integralCheckGSY.getOgintegration());
integralCheckNew.setCpintegration(integralCheckGSY.getCpintegration());
integralCheckNew.setRestintegraltionbefore(integralCheckGSY.getRestintegraltionbefore());
integralCheckNew.setOgintegrationbefore(integralCheckGSY.getOgintegrationbefore());
integralCheckNew.setCpintegrationbefore(integralCheckGSY.getCpintegrationbefore());
integralCheckNew.setClassdate(integralCheckGSY.getClassdate());
integralCheckNew.setRestintegraltiondecode(integralCheckBMP.getRestintegraltiondecode());
integralCheckNew.setCpintegrationdecode(integralCheckBMP.getCpintegrationdecode());
integralCheckNew.setOgintegrationdecode(integralCheckBMP.getOgintegrationdecode());
integralCheckNew.setResttegraltionadd(integralCheckGSY.getResttegraltionadd());
integralCheckNew.setOgintegrationadd(integralCheckGSY.getOgintegrationadd());
integralCheckNew.setCpintegrationadd(integralCheckGSY.getCpintegrationadd());
integralCheckNew.setUserRealName(integralCheckGSY.getUserRealName());
integralCheckNew.setUserId(integralCheckGSY.getUserId());
integralCheckNew.setOpenid(integralCheckGSY.getOpenid());
integralCheckNew.setIsRight("Y");
//先判断剩余积分是否准确
if(integralCheckBMP.getEnableintegration().intValue() == integralCheckGSY.getEnableintegration().intValue()
&& integralCheckBMP.getOgintegration().intValue() == integralCheckGSY.getOgintegration().intValue()
&& integralCheckBMP.getCpintegration().intValue() == integralCheckGSY.getCpintegration().intValue()
&& integralCheckBMP.getRestintegraltionbefore().intValue() == integralCheckGSY.getRestintegraltionbefore().intValue()
&& integralCheckBMP.getOgintegrationbefore().intValue() == integralCheckGSY.getOgintegrationbefore().intValue()
&& integralCheckBMP.getCpintegrationbefore().intValue() == integralCheckGSY.getCpintegrationbefore().intValue()){
int OGFee = integralCheckBMP.getOgintegrationdecode().intValue();
int CPFee = integralCheckBMP.getCpintegrationdecode().intValue();
int OGAdd = integralCheckGSY.getOgintegrationadd().intValue();
int CPAdd = integralCheckGSY.getCpintegrationadd().intValue();
int feeTotal = (OGFee+CPFee);
int addTotal = (OGAdd+CPAdd);
//判断 加油加汽核销积分 + 餐饮商超核销积分 是否等于总核销积分
if(integralCheckNew.getRestintegraltiondecode().intValue() != feeTotal){
integralCheckNew.setIsRight("N");
}
//判断 加油加汽增加积分 + 餐饮商超增加积分 是否等于总增加积分
if(integralCheckNew.getResttegraltionadd().intValue() != addTotal){
integralCheckNew.setIsRight("N");
}
//判断 前日剩余 累计 核销积分和增加积分后,是否等于昨日剩余积分情况
if((integralCheckNew.getRestintegraltionbefore().intValue()+feeTotal+addTotal) != integralCheckNew.getEnableintegration().intValue() ){
integralCheckNew.setIsRight("N");
}
//判断 前日剩余 累计 核销积分和增加积分后,是否等于昨日剩余积分情况
if((integralCheckNew.getOgintegrationbefore().intValue()+OGFee+OGAdd) != integralCheckNew.getOgintegration().intValue() ){
integralCheckNew.setIsRight("N");
}
//判断 前日剩余 累计 核销积分和增加积分后,是否等于昨日剩余积分情况
if((integralCheckNew.getCpintegrationbefore().intValue()+CPFee+CPAdd) != integralCheckNew.getCpintegration().intValue() ){
integralCheckNew.setIsRight("N");
}
if(integralCheckNew.getEnableintegration().intValue() < 0 || integralCheckNew.getOgintegration().intValue() < 0 || integralCheckNew.getCpintegration().intValue() < 0){
integralCheckNew.setIsRight("N");
}
}else{
integralCheckNew.setIsRight("N");
}
newRecords.add(integralCheckNew);
}
page.setRecords(newRecords);
return page;
}
@Override
public void exportCheckListExcle(String searchForm, HttpServletResponse response) throws Exception {
//设置金额的格式
DecimalFormat decimalFormat = new DecimalFormat("#.00");
//设置导出文件名称
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
String filename = "积分检查表-" + simpleDateFormat.format(date) + ".xlsx";
HashMap<String, Object> paramsMap = new HashMap<>();
//如果传进来的参数有值,拼接参数
if (null != searchForm && !"".equals(searchForm)) {
paramsMap = JSON.parseObject(searchForm, HashMap.class);
}
//从配置文件中读取数据库连接类型
paramsMap.put("DBTYPE", PropertiesUtil.getValue("DBType"));
//设置分页
Integer pageNum = (Integer) paramsMap.get("pageNum");
Page<IntegralCheck> page = new Page<>(pageNum,100000);
page = integralCheckMapper.getCheckPage(page, paramsMap);
//获取数据,判断用户积分是否正确,没有异常 01 0 23 2 45 4
List<IntegralCheck> records = page.getRecords();
List<IntegralCheck> newRecords = new ArrayList<>();
for(int i = 0 ; i < records.size();i=i+2){
IntegralCheck integralCheckNew = new IntegralCheck();
IntegralCheck integralCheckBMP = records.get(i);
IntegralCheck integralCheckGSY = records.get(i+1);
integralCheckNew.setEnableintegration(integralCheckGSY.getEnableintegration());
integralCheckNew.setOgintegration(integralCheckGSY.getOgintegration());
integralCheckNew.setCpintegration(integralCheckGSY.getCpintegration());
integralCheckNew.setRestintegraltionbefore(integralCheckGSY.getRestintegraltionbefore());
integralCheckNew.setOgintegrationbefore(integralCheckGSY.getOgintegrationbefore());
integralCheckNew.setCpintegrationbefore(integralCheckGSY.getCpintegrationbefore());
integralCheckNew.setClassdate(integralCheckGSY.getClassdate());
integralCheckNew.setRestintegraltiondecode(integralCheckBMP.getRestintegraltiondecode());
integralCheckNew.setCpintegrationdecode(integralCheckBMP.getCpintegrationdecode());
integralCheckNew.setOgintegrationdecode(integralCheckBMP.getOgintegrationdecode());
integralCheckNew.setResttegraltionadd(integralCheckGSY.getResttegraltionadd());
integralCheckNew.setOgintegrationadd(integralCheckGSY.getOgintegrationadd());
integralCheckNew.setCpintegrationadd(integralCheckGSY.getCpintegrationadd());
integralCheckNew.setUserRealName(integralCheckGSY.getUserRealName());
integralCheckNew.setUserId(integralCheckGSY.getUserId());
integralCheckNew.setOpenid(integralCheckGSY.getOpenid());
integralCheckNew.setIsRight("Y");
//先判断剩余积分是否准确
if(integralCheckBMP.getEnableintegration().intValue() == integralCheckGSY.getEnableintegration().intValue()
&& integralCheckBMP.getOgintegration().intValue() == integralCheckGSY.getOgintegration().intValue()
&& integralCheckBMP.getCpintegration().intValue() == integralCheckGSY.getCpintegration().intValue()
&& integralCheckBMP.getRestintegraltionbefore().intValue() == integralCheckGSY.getRestintegraltionbefore().intValue()
&& integralCheckBMP.getOgintegrationbefore().intValue() == integralCheckGSY.getOgintegrationbefore().intValue()
&& integralCheckBMP.getCpintegrationbefore().intValue() == integralCheckGSY.getCpintegrationbefore().intValue()){
int OGFee = integralCheckBMP.getOgintegrationdecode().intValue();
int CPFee = integralCheckBMP.getCpintegrationdecode().intValue();
int OGAdd = integralCheckGSY.getOgintegrationadd().intValue();
int CPAdd = integralCheckGSY.getCpintegrationadd().intValue();
int feeTotal = (OGFee+CPFee);
int addTotal = (OGAdd+CPAdd);
//判断 加油加汽核销积分 + 餐饮商超核销积分 是否等于总核销积分
if(integralCheckNew.getRestintegraltiondecode().intValue() != feeTotal){
integralCheckNew.setIsRight("N");
}
//判断 加油加汽增加积分 + 餐饮商超增加积分 是否等于总增加积分
if(integralCheckNew.getResttegraltionadd().intValue() != addTotal){
integralCheckNew.setIsRight("N");
}
//判断 前日剩余 累计 核销积分和增加积分后,是否等于昨日剩余积分情况
if((integralCheckNew.getRestintegraltionbefore().intValue()+feeTotal+addTotal) != integralCheckNew.getEnableintegration().intValue() ){
integralCheckNew.setIsRight("N");
}
//判断 前日剩余 累计 核销积分和增加积分后,是否等于昨日剩余积分情况
if((integralCheckNew.getOgintegrationbefore().intValue()+OGFee+OGAdd) != integralCheckNew.getOgintegration().intValue() ){
integralCheckNew.setIsRight("N");
}
//判断 前日剩余 累计 核销积分和增加积分后,是否等于昨日剩余积分情况
if((integralCheckNew.getCpintegrationbefore().intValue()+CPFee+CPAdd) != integralCheckNew.getCpintegration().intValue() ){
integralCheckNew.setIsRight("N");
}
if(integralCheckNew.getEnableintegration().intValue() < 0 || integralCheckNew.getOgintegration().intValue() < 0 || integralCheckNew.getCpintegration().intValue() < 0){
integralCheckNew.setIsRight("N");
}
}else{
integralCheckNew.setIsRight("N");
}
newRecords.add(integralCheckNew);
}
Collections.sort(newRecords, new Comparator<IntegralCheck>() {
@Override
public int compare(IntegralCheck p1, IntegralCheck p2) {
return p1.getIsRight().compareTo(p2.getIsRight());
}
});
//创建一个Excel表格
Workbook wb = new XSSFWorkbook();
//创建sheet页面
Sheet sheet = wb.createSheet("积分检查");
if (null == newRecords) {
//导出Excel
writeToExcel(response, wb, filename);
}
//定义一个标题数组
String[] title = {"积分状态", "用户","统计日期", "前日剩余可用积分", "昨日消费积分","昨日增加积分","昨日剩余可用积分", "前日加油加气剩余可用积分", "昨日加油加气消费积分","昨日加油加气增加积分","昨日加油加气剩余可用积分", "前日餐饮商超剩余可用积分", "昨日餐饮商超消费积分","昨日餐饮商超增加积分","昨日餐饮商超剩余可用积分"};
//设置统计时间日期格式
SimpleDateFormat simpleDateFormatClassData = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat simpleDateFormatDt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//定义内容数据
List<String[]> rowValues = new ArrayList<>();
for (IntegralCheck check: newRecords) {
String[] rowValue = {
null == check.getIsRight()? "" : check.getIsRight().equals("Y")?"正常":"异常",
null == check.getUserRealName()? "" : check.getUserRealName(),
null == check.getClassdate()? "" : simpleDateFormatClassData.format(check.getClassdate()),
null == check.getRestintegraltionbefore()? "" : String.valueOf(check.getRestintegraltionbefore().intValue()/100.00),
null == check.getRestintegraltiondecode()? "" : String.valueOf(check.getRestintegraltiondecode().intValue()/100.00),
null == check.getResttegraltionadd()? "" : String.valueOf(check.getResttegraltionadd().intValue()/100.00),
null == check.getEnableintegration()? "" : String.valueOf(check.getEnableintegration().intValue()/100.00),
null == check.getOgintegrationbefore()? "" : String.valueOf(check.getOgintegrationbefore().intValue()/100.00),
null == check.getOgintegrationdecode()? "" : String.valueOf(check.getOgintegrationdecode().intValue()/100.00),
null == check.getOgintegrationadd()? "" : String.valueOf(check.getOgintegrationadd().intValue()/100.00),
null == check.getOgintegration()? "" : String.valueOf(check.getOgintegration().intValue()/100.00),
null == check.getCpintegrationbefore()? "" : String.valueOf(check.getCpintegrationbefore().intValue()/100.00),
null == check.getCpintegrationdecode()? "" : String.valueOf(check.getCpintegrationdecode().intValue()/100.00),
null == check.getCpintegrationadd()? "" : String.valueOf(check.getCpintegrationadd().intValue()/100.00),
null == check.getCpintegration()? "" : String.valueOf(check.getCpintegration().intValue()/100.00),
};
rowValues.add(rowValue);
}
//设置标题单元格式
CellStyle cellStyleTitle = wb.createCellStyle();
cellStyleTitle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());//设置背景色
cellStyleTitle.setFillPattern((short) 1);//必须设置 否则无效
//设置水平垂直居中
cellStyleTitle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
cellStyleTitle.setVerticalAlignment(HSSFCellStyle.ALIGN_CENTER);
// 设置边框样式
cellStyleTitle.setBorderBottom(XSSFCellStyle.BORDER_THIN);
cellStyleTitle.setBorderLeft(XSSFCellStyle.BORDER_THIN);
cellStyleTitle.setBorderRight(XSSFCellStyle.BORDER_THIN);
cellStyleTitle.setBorderTop(XSSFCellStyle.BORDER_THIN);
//定义标题内容
Row currentRow = sheet.createRow(0);
// 往Excel表格中添加标题的数据
for (int j = 0; j < title.length; j++) {
if(j > 6){
// 设置列宽
sheet.setColumnWidth(j, 12000);
}else{
// 设置列宽
sheet.setColumnWidth(j, 8000);
}
Cell cell = currentRow.createCell(j);
cell.setCellStyle(cellStyleTitle);
//每个单元格的值目前做 String 处理
//cell.setCellType(CellType.STRING);
cell.setCellValue(title[j]);
}
//往Excel表格中添加具体数据
for (int i = 0; i < rowValues.size(); i++) {
String status = rowValues.get(i)[0];
//设置内容单元格式
CellStyle cellStyleValue = wb.createCellStyle();
if(status.equals("正常")){
//设置水平垂直居中
cellStyleValue.setAlignment(HSSFCellStyle.ALIGN_CENTER);
cellStyleValue.setVerticalAlignment(HSSFCellStyle.ALIGN_CENTER);
// 设置边框样式
cellStyleValue.setBorderBottom(XSSFCellStyle.BORDER_THIN);
cellStyleValue.setBorderLeft(XSSFCellStyle.BORDER_THIN);
cellStyleValue.setBorderRight(XSSFCellStyle.BORDER_THIN);
cellStyleValue.setBorderTop(XSSFCellStyle.BORDER_THIN);
cellStyleValue.setFillPattern(CellStyle.SOLID_FOREGROUND);
cellStyleValue.setFillBackgroundColor(IndexedColors.LIME.getIndex());
cellStyleValue.setFillForegroundColor(IndexedColors.LIME.getIndex());
}else{
//设置水平垂直居中
cellStyleValue.setAlignment(HSSFCellStyle.ALIGN_CENTER);
cellStyleValue.setVerticalAlignment(HSSFCellStyle.ALIGN_CENTER);
// 设置边框样式
cellStyleValue.setBorderBottom(XSSFCellStyle.BORDER_THIN);
cellStyleValue.setBorderLeft(XSSFCellStyle.BORDER_THIN);
cellStyleValue.setBorderRight(XSSFCellStyle.BORDER_THIN);
cellStyleValue.setBorderTop(XSSFCellStyle.BORDER_THIN);
cellStyleValue.setFillPattern(CellStyle.SOLID_FOREGROUND);
cellStyleValue.setFillBackgroundColor(IndexedColors.CORAL.getIndex());
cellStyleValue.setFillForegroundColor(IndexedColors.CORAL.getIndex());
}
Row Row = sheet.createRow((i + 1));
for (int j = 0; j < title.length; j++) {
if(j > 6){
// 设置列宽
sheet.setColumnWidth(j, 12000);
}else{
// 设置列宽
sheet.setColumnWidth(j, 8000);
}
Cell cell = Row.createCell(j);
cell.setCellStyle(cellStyleValue);
//每个单元格的值目前做 String 处理
//cell.setCellType(CellType.STRING);
cell.setCellValue(rowValues.get(i)[j]);
}
}
//导出Excel
writeToExcel(response, wb, filename);
}
/**
* Excelresponse
*
* @param response
* @param wb
* @param fileName
* @throws Exception
*/
public void writeToExcel(HttpServletResponse response, Workbook wb, String fileName) throws Exception {
OutputStream os = null;
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
response.setCharacterEncoding(Charsets.UTF_8.name());
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s", new String(URLEncoder.encode(fileName, Charsets.UTF_8.name())
.getBytes(Charsets.UTF_8), Charsets.ISO_8859_1)));
os = response.getOutputStream();
wb.write(os);
os.flush();
}
}

@ -1,9 +1,11 @@
package com.nmgs.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nmgs.entity.Cafter;
import com.nmgs.entity.ServiceAreaOperators;
import com.nmgs.mapper.bak.OperatorsBakMapper;
import com.nmgs.mapper.petrol.OperatorsMapper;
@ -11,13 +13,24 @@ import com.nmgs.service.IOperatorsService;
import com.nmgs.util.*;
import com.trkf.PasswordEncryption.PassWordUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.Charsets;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
@ -365,4 +378,163 @@ public class OperatorsServiceImpl implements IOperatorsService {
}
@Override
public void exportOperationListExcle(String searchForm, HttpServletResponse response)throws Exception{
//设置金额的格式
DecimalFormat decimalFormat = new DecimalFormat("#.00");
//设置导出文件名称
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
String filename = "商户信息-" + simpleDateFormat.format(date) + ".xlsx";
HashMap<String, Object> paramsMap = new HashMap<>();
//如果传进来的参数有值,拼接参数
if (null != searchForm && !"".equals(searchForm)) {
paramsMap = JSON.parseObject(searchForm, HashMap.class);
}
if(paramsMap.get("companyIds") != null && !"".equals(paramsMap.get("companyIds") )){
String companyIds = (String) paramsMap.get("companyIds");
String[] split = companyIds.split(",");
paramsMap.put("companyIds",Arrays.asList(split));
}
//根据条件查询绿通数据
//从配置文件中读取数据库连接类型
paramsMap.put("DBTYPE", PropertiesUtil.getValue("DBType"));
//设置分页
Integer pageNum = (Integer) paramsMap.get("pageNum");
Integer pageSize = (Integer) paramsMap.get("pageSize");
Page<ServiceAreaOperators> page = new Page<>(pageNum,100000);
page = operatorsMapper.getOperatorsList(page,paramsMap);
//给密码解密
List<ServiceAreaOperators> records = page.getRecords();
if(null != records && records.size() > 0){
for (ServiceAreaOperators record : records) {
record.setPassWord(PassWordUtils.decrypt(record.getPassWord()));
}
page.setRecords(records);
}
//创建一个Excel表格
Workbook wb = new XSSFWorkbook();
//创建sheet页面
Sheet sheet = wb.createSheet("商户信息");
if (null == records) {
//导出Excel
writeToExcel(response, wb, filename);
}
//定义一个标题数组
String[] title = {"商户工号", "密码", "商户名称", "商户角色","所属公司","所属服务区", "商户信息", "商户联系方式","商户状态"};
//设置统计时间日期格式
SimpleDateFormat simpleDateFormatClassData = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat simpleDateFormatDt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//定义内容数据
List<String[]> rowValues = new ArrayList<>();
for (ServiceAreaOperators serviceAreaOperators : records) {
String[] rowValue = {
null == serviceAreaOperators.getJobNumber() ? "" : serviceAreaOperators.getJobNumber(),
null == serviceAreaOperators.getPassWord() ? "" : serviceAreaOperators.getPassWord(),
null == serviceAreaOperators.getUserName() ? "" : serviceAreaOperators.getUserName(),
null == serviceAreaOperators.getRoleName() ? "" : serviceAreaOperators.getRoleName(),
null == serviceAreaOperators.getCompanyName() ? "" : serviceAreaOperators.getCompanyName(),
null == serviceAreaOperators.getServiceAreaName() ? "" : serviceAreaOperators.getServiceAreaName(),
null == serviceAreaOperators.getJobNumberInfo() ? "" : serviceAreaOperators.getJobNumberInfo(),
null == serviceAreaOperators.getPhone() ? "" : serviceAreaOperators.getPhone(),
null == serviceAreaOperators.getOPEN() ? "" : serviceAreaOperators.getOPEN() == 1 ?"营业中":"暂停营业"
};
rowValues.add(rowValue);
}
//设置标题单元格式
CellStyle cellStyleTitle = wb.createCellStyle();
cellStyleTitle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());//设置背景色
cellStyleTitle.setFillPattern((short) 1);//必须设置 否则无效
//设置水平垂直居中
cellStyleTitle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
cellStyleTitle.setVerticalAlignment(HSSFCellStyle.ALIGN_CENTER);
// 设置边框样式
cellStyleTitle.setBorderBottom(XSSFCellStyle.BORDER_THIN);
cellStyleTitle.setBorderLeft(XSSFCellStyle.BORDER_THIN);
cellStyleTitle.setBorderRight(XSSFCellStyle.BORDER_THIN);
cellStyleTitle.setBorderTop(XSSFCellStyle.BORDER_THIN);
//定义标题内容
Row currentRow = sheet.createRow(0);
// 往Excel表格中添加标题的数据
for (int j = 0; j < title.length; j++) {
// 设置列宽
sheet.setColumnWidth(j, 4100);
Cell cell = currentRow.createCell(j);
cell.setCellStyle(cellStyleTitle);
//每个单元格的值目前做 String 处理
//cell.setCellType(CellType.STRING);
cell.setCellValue(title[j]);
}
//设置内容单元格式
CellStyle cellStyleValue = wb.createCellStyle();
//设置水平垂直居中
cellStyleValue.setAlignment(HSSFCellStyle.ALIGN_CENTER);
cellStyleValue.setVerticalAlignment(HSSFCellStyle.ALIGN_CENTER);
// 设置边框样式
cellStyleValue.setBorderBottom(XSSFCellStyle.BORDER_THIN);
cellStyleValue.setBorderLeft(XSSFCellStyle.BORDER_THIN);
cellStyleValue.setBorderRight(XSSFCellStyle.BORDER_THIN);
cellStyleValue.setBorderTop(XSSFCellStyle.BORDER_THIN);
//往Excel表格中添加具体数据
for (int i = 0; i < rowValues.size(); i++) {
Row Row = sheet.createRow((i + 1));
for (int j = 0; j < title.length; j++) {
// 设置列宽
sheet.setColumnWidth(j, 6000);
Cell cell = Row.createCell(j);
cell.setCellStyle(cellStyleValue);
//每个单元格的值目前做 String 处理
//cell.setCellType(CellType.STRING);
cell.setCellValue(rowValues.get(i)[j]);
}
}
//导出Excel
writeToExcel(response, wb, filename);
}
/**
* Excelresponse
*
* @param response
* @param wb
* @param fileName
* @throws Exception
*/
public void writeToExcel(HttpServletResponse response, Workbook wb, String fileName) throws Exception {
OutputStream os = null;
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
response.setCharacterEncoding(Charsets.UTF_8.name());
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s", new String(URLEncoder.encode(fileName, Charsets.UTF_8.name())
.getBytes(Charsets.UTF_8), Charsets.ISO_8859_1)));
os = response.getOutputStream();
wb.write(os);
os.flush();
}
}

@ -4,6 +4,7 @@ import com.nmgs.entity.IntegralCheck;
import com.nmgs.mapper.bak.IntegralCheckBakMapper;
import com.nmgs.mapper.petrol.IntegralCheckMapper;
import com.nmgs.util.PropertiesUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -11,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Slf4j
public class SolveCheckServiceImpl {
public IntegralCheckMapper integralCheckMapper;
@ -33,7 +35,7 @@ public class SolveCheckServiceImpl {
if(PropertiesUtil.getValue("IsBak").equals("1")){
integralCheckBakMapper.insert(integralCheck);
}
System.out.println("次数===" + i);
log.info("次数===" + i);
}
}
}

@ -37,6 +37,8 @@ import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
@Service
@Slf4j
@ -83,7 +85,8 @@ public class UserServiceImpl implements IUserService {
@Autowired
private UserBakMapper userBakMapper;
@Autowired
private Executor PertolCafeteriaFeeThreadPool;
@Override
@ -450,28 +453,46 @@ public class UserServiceImpl implements IUserService {
List<Map<String,Object>> userList = (List<Map<String, Object>>) params.get("userList");
params.put("peyType","AMT");
//判断该月份,是否已经增加过奖励
List<IntegrationList> amtScoreByTime = integrationListMapper.getScoreByTimeAndType(params);
if(null != amtScoreByTime && !amtScoreByTime.isEmpty()){
return -2;
}
List<JSONObject> userMsg = new ArrayList<>();
List<JSONObject> userMsg = new Vector<>();
//设置分页
Integer pageNum = (Integer) params.get("pageNum");
Integer pageSize = (Integer) params.get("pageSize");
Page<Map<String, Object>> page = new Page<>(pageNum,500000);
page = userMapper.getUserMonthMileTotalNew(page,params);
List<Map<String, Object>> records = page.getRecords();
//多线程处理
CountDownLatch countDownLatch = new CountDownLatch(records.size()); // 同步工具
if(null != records && !records.isEmpty()){
for (Map<String, Object> record : records) {
JSONObject jsonObject = addService.saveATMScore(record, (String) params.get("startTime"),loginId);
if (null != jsonObject) {
userMsg.add(jsonObject);
}
Map<String, Object> hashSyncMap = Collections.synchronizedMap(record);
StringBuffer startTime = new StringBuffer((String)params.get("startTime"));
StringBuffer loginUserId = new StringBuffer(loginId);
PertolCafeteriaFeeThreadPool.execute(() -> {
JSONObject jsonObject = null;
try {
jsonObject = addService.saveATMScore(hashSyncMap, startTime.toString(), loginUserId.toString());
} catch (Exception e) {
e.printStackTrace();
log.error("新增月里程排名积分失败",e);
countDownLatch.countDown();
}
if (null != jsonObject) {
userMsg.add(jsonObject);
}
countDownLatch.countDown();
});
}
//等待子线程执行完毕
countDownLatch.await();
log.info("主线程工作结束==============");
}
//获取推送积分url信息
List<Map<String, Object>> changeMsgPush = userMapper.getChangeMshUrl("CHANGE_MSG_PUSH");

@ -305,7 +305,7 @@ public class UserVehicleServiceImpl implements IUserVehicleService {
//从配置文件中读取上传文件接口
String fileDelUrl = PropertiesUtil.getValue("fileDelUrl");
//备份文件位置
String manageAddressLinux = PropertiesUtil.getValue("manageAddressLinux");
String fileAddressLinux = PropertiesUtil.getValue("fileAddressLinux");
//备份图片
String property = System.getProperty("catalina.home");
//记录存放日期文件夹
@ -328,9 +328,9 @@ public class UserVehicleServiceImpl implements IUserVehicleService {
UpdateWrapper<UserVehicle> updateWrapperMile = new UpdateWrapper<>();
try{
//获取图片,修改名称,重新上传
String base64Lic = ImageUtil.getImgFileToBase64(property+manageAddressLinux+userVehicle.getLicensePicName());
String base64Vehicle = ImageUtil.getImgFileToBase64(property+manageAddressLinux+userVehicle.getVehiclePicName());
String base64Permit = ImageUtil.getImgFileToBase64(property+manageAddressLinux+userVehicle.getPermitPicName());
String base64Lic = ImageUtil.getImgFileToBase64(fileAddressLinux+userVehicle.getLicensePicName());
String base64Vehicle = ImageUtil.getImgFileToBase64(fileAddressLinux+userVehicle.getVehiclePicName());
String base64Permit = ImageUtil.getImgFileToBase64(fileAddressLinux+userVehicle.getPermitPicName());
//删除图片
if(null != fileDelUrl && !fileDelUrl.isEmpty()){
@ -342,7 +342,7 @@ public class UserVehicleServiceImpl implements IUserVehicleService {
map.put("fileName", userVehicle.getLicensePicName());
map.put("canDel", "Y");
HttpClientUtil.doPost(delUrl, map);
File file = new File(property+manageAddressLinux+userVehicle.getLicensePicName());
File file = new File(fileAddressLinux+userVehicle.getLicensePicName());
file.delete();
}
}
@ -355,7 +355,7 @@ public class UserVehicleServiceImpl implements IUserVehicleService {
map.put("fileName", userVehicle.getVehiclePicName());
map.put("canDel", "Y");
HttpClientUtil.doPost(delUrl, map);
File file = new File(property+manageAddressLinux+userVehicle.getVehiclePicName());
File file = new File(fileAddressLinux+userVehicle.getVehiclePicName());
file.delete();
}
}
@ -368,7 +368,7 @@ public class UserVehicleServiceImpl implements IUserVehicleService {
map.put("fileName", userVehicle.getPermitPicName());
map.put("canDel", "Y");
HttpClientUtil.doPost(delUrl, map);
File file = new File(property+manageAddressLinux+userVehicle.getPermitPicName());
File file = new File(fileAddressLinux+userVehicle.getPermitPicName());
file.delete();
}
}
@ -389,7 +389,7 @@ public class UserVehicleServiceImpl implements IUserVehicleService {
jsonA.add(mapUpdateParam);
mapUpdate.put("jsonArray", jsonA.toJSONString());
String result = HttpClientUtil.doPost(uploadUrl, mapUpdate);
ImageUtil.generateImage(base64Lic,property+manageAddressLinux+dateMdk, property+manageAddressLinux+dateMdk+"/"+userVehicle.getUserId()+"-"+newACarNo+"-LICPIC.jpg");
ImageUtil.generateImage(base64Lic,fileAddressLinux+dateMdk, fileAddressLinux+dateMdk+"/"+userVehicle.getUserId()+"-"+newACarNo+"-LICPIC.jpg");
}
}
if(null != uploadFileUrl && !uploadFileUrl.isEmpty()){
@ -404,7 +404,7 @@ public class UserVehicleServiceImpl implements IUserVehicleService {
jsonA.add(mapUpdateParam);
mapUpdate.put("jsonArray", jsonA.toJSONString());
String result = HttpClientUtil.doPost(uploadUrl, mapUpdate);
ImageUtil.generateImage(base64Vehicle,property+manageAddressLinux+dateMdk, property+manageAddressLinux+dateMdk+"/"+userVehicle.getUserId()+"-"+newACarNo+"-VEHPIC.jpg");
ImageUtil.generateImage(base64Vehicle,fileAddressLinux+dateMdk, fileAddressLinux+dateMdk+"/"+userVehicle.getUserId()+"-"+newACarNo+"-VEHPIC.jpg");
}
}
if(null != uploadFileUrl && !uploadFileUrl.isEmpty()){
@ -419,7 +419,7 @@ public class UserVehicleServiceImpl implements IUserVehicleService {
jsonA.add(mapUpdateParam);
mapUpdate.put("jsonArray", jsonA.toJSONString());
String result = HttpClientUtil.doPost(uploadUrl, mapUpdate);
ImageUtil.generateImage(base64Permit,property+manageAddressLinux+dateMdk, property+manageAddressLinux+dateMdk+"/"+userVehicle.getUserId()+"-"+newACarNo+"-PERPIC.jpg");
ImageUtil.generateImage(base64Permit,fileAddressLinux+dateMdk, fileAddressLinux+dateMdk+"/"+userVehicle.getUserId()+"-"+newACarNo+"-PERPIC.jpg");
}
}
userVehicle.setVehiclePicName(dateMdk+"/"+userVehicle.getUserId()+"-"+newACarNo+"-VEHPIC.jpg");

@ -44,7 +44,7 @@ public class CallBackGreenIntegralTask {
@Autowired
private WebSocketServer webSocketServer;
//@Scheduled(cron = " 0 0/3 * * * ? ")//15秒执行一次
@Scheduled(cron = " 0 0/3 * * * ? ")//15秒执行一次
@Transactional
public synchronized void callBackGreen() {
try {

@ -16,10 +16,7 @@ import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
*
@ -48,7 +45,7 @@ public class ConsumeIntegralCheck {
this.solveCheckService = solveCheckService;
}
@Scheduled(cron = " 0 0 11 * * ? ")//每日9点执行一次
@Scheduled(cron = " 0 0 1 * * ? ")//每日凌晨1点执行执行一次
public void check() {
try {
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
@ -66,7 +63,7 @@ public class ConsumeIntegralCheck {
IntegralCheck integralCheck=new IntegralCheck();
integralCheck.setUserId(userId);
integralCheck.setOpenid(userIdO.getOpenId());
integralCheck.setOperatorTime(df.parse(PubTools.getCurrentDate()));
integralCheck.setOperatorTime(new Date());
integralCheck.setClassdate(df.parse(PubTools.getBeforeDaySSS(PubTools.getCurrentDateYYD(),1)));
integralCheck.setCpintegrationadd(BigDecimal.ZERO);
integralCheck.setOgintegrationadd(BigDecimal.ZERO);
@ -153,11 +150,11 @@ public class ConsumeIntegralCheck {
integralCheck.setRestintegraltiondecode(RESTINTEGRALTIONDECODE);
integralCheck.setOpertor("BMP");
list.add(integralCheck);
System.out.println("处理完数据次数===" + i);
log.info("处理完数据次数===" + i);
}
solveCheckService.solveCheck(list);
} catch (Exception e) {
System.out.println("接口异常了:"+e.getMessage());
log.error("接口异常了:"+e.getMessage());
e.printStackTrace();
}
}

@ -0,0 +1,209 @@
package com.nmgs.task;
import com.nmgs.entity.IntegralCheck;
import com.nmgs.entity.IntegrationList;
import com.nmgs.entity.PayIntegrationNumber;
import com.nmgs.entity.User;
import com.nmgs.mapper.petrol.IntegrationListMapper;
import com.nmgs.mapper.petrol.PayIntegrationNumberMapper;
import com.nmgs.mapper.petrol.UserMapper;
import com.nmgs.service.impl.SolveCheckServiceImpl;
import com.nmgs.util.PropertiesUtil;
import com.nmgs.util.PubTools;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
/**
*
* author: GSY
* date: 20250731 11:00
*/
@Component
@Async
@Slf4j
public class IntegralCheckTask {
@Autowired
public UserMapper userMapper;
@Autowired
public IntegrationListMapper integrationListMapper;
@Autowired
public SolveCheckServiceImpl solveCheckService;
@Autowired
private PayIntegrationNumberMapper payIntegrationNumberMapper;
@Autowired
private Executor PertolCafeteriaFeeThreadPool;
@Scheduled(cron = " 0 0 3 * * ? ")//每日凌晨3点执行执行一次
public void check() {
try {
List<IntegralCheck> integralCheckList = new Vector<>();
//设置统计时间日期格式
SimpleDateFormat simpleDateFormatClassData = new SimpleDateFormat("yyyy-MM-dd");
//查出昨天有消费记录的人员
Calendar calendarYesterday = Calendar.getInstance();
calendarYesterday.setTime(new Date());
calendarYesterday.add(Calendar.DATE, -1);
//构建表名
Map<String, Object> paramUser = new HashMap<>();
// 格式化输出(如果需要)
paramUser.put("startTime", simpleDateFormatClassData.format(calendarYesterday.getTime()) + " 00:00:00");
paramUser.put("endTime", simpleDateFormatClassData.format(new Date()) + " 00:00:00");
//从配置文件中读取数据库连接类型
paramUser.put("DBTYPE", PropertiesUtil.getValue("DBType"));
List<User> userByInteralList = userMapper.getHasIntegralChangeList(paramUser);
//获取餐饮消费积分占比,加油加汽积分占比
PayIntegrationNumber ogPercent = payIntegrationNumberMapper.getAuScore("BOG");
if (null == ogPercent || null == ogPercent.getValue()) {
ogPercent = new PayIntegrationNumber();
ogPercent.setValue(new BigDecimal("0.60"));
}else{
ogPercent.setValue(ogPercent.getValue().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP));
}
PayIntegrationNumber csPercent = payIntegrationNumberMapper.getAuScore("BCS");
if (null == csPercent || null == csPercent.getValue()) {
csPercent = new PayIntegrationNumber();
csPercent.setValue(new BigDecimal("0.40"));
}else{
csPercent.setValue(csPercent.getValue().divide(new BigDecimal(100), 2, RoundingMode.HALF_UP));
}
if (null != userByInteralList && !userByInteralList.isEmpty()) {
//多线程处理
CountDownLatch countDownLatch = new CountDownLatch(userByInteralList.size()); // 同步工具
for (User user : userByInteralList) {
PayIntegrationNumber finalOgPercent = ogPercent;
PayIntegrationNumber finalCsPercent = csPercent;
PertolCafeteriaFeeThreadPool.execute(() -> {
//设置统计时间日期格式
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
//获取昨天的剩余积分
IntegralCheck integralCheck = new IntegralCheck();
integralCheck.setUserId(user.getId());
integralCheck.setOpenid(user.getOpenId());
integralCheck.setClassdate(simpleDateFormat.parse(simpleDateFormat.format(calendarYesterday.getTime()) + " 00:00:00"));
integralCheck.setOperatorTime(new Date());
/**
* ENABLEINTEGRATION NUMBER 0 0 0 0 0 0 0 0 VISIBLE
* OGINTEGRATION NUMBER 0 0 0 0 0 0 0 0 VISIBLE
* CPINTEGRATION NUMBER 0 0 0 0 0 0 0 0 VISIBLE
*/
//查询今日0点用户积分情况
//构建表名
Map<String, Object> paramYesterday = new HashMap<>();
paramYesterday.put("endTime", simpleDateFormat.format(new Date()) + " 00:00:00");
paramYesterday.put("userId",user.getId());
paramYesterday.put("DBTYPE", PropertiesUtil.getValue("DBType"));
List<IntegrationList> yesterdayUserIntegration = integrationListMapper.getUserIntegration(paramYesterday);
if(null != yesterdayUserIntegration && !yesterdayUserIntegration.isEmpty()){
integralCheck.setEnableintegration(yesterdayUserIntegration.get(0).getRestIntegration());
integralCheck.setOgintegration(yesterdayUserIntegration.get(0).getOgEnableIntegration());
integralCheck.setCpintegration(yesterdayUserIntegration.get(0).getCpEnableIntegration());
}else{
integralCheck.setEnableintegration(new BigDecimal(0));
integralCheck.setOgintegration(new BigDecimal(0));
integralCheck.setCpintegration(new BigDecimal(0));
}
/**
* RESTINTEGRALTIONBEFORE NUMBER 0 0 -1 0 0 0 0 0 VISIBLE
* OGINTEGRATIONBEFORE NUMBER 0 0 -1 0 0 0 0 0 VISIBLE
* CPINTEGRATIONBEFORE NUMBER 0 0 -1 0 0 0 0 0 VISIBLE
*/
//查询昨日0点用户积分情况
//构建表名
Map<String, Object> paramBeforeYesterday = new HashMap<>();
paramBeforeYesterday.put("endTime", simpleDateFormat.format(calendarYesterday.getTime()) + " 00:00:00");
paramBeforeYesterday.put("userId",user.getId());
paramBeforeYesterday.put("DBTYPE", PropertiesUtil.getValue("DBType"));
List<IntegrationList> beforeYesterdayUserIntegration = integrationListMapper.getUserIntegration(paramBeforeYesterday);
if(null != beforeYesterdayUserIntegration && !beforeYesterdayUserIntegration.isEmpty()){
integralCheck.setRestintegraltionbefore(beforeYesterdayUserIntegration.get(0).getRestIntegration());
integralCheck.setOgintegrationbefore(beforeYesterdayUserIntegration.get(0).getOgEnableIntegration());
integralCheck.setCpintegrationbefore(beforeYesterdayUserIntegration.get(0).getCpEnableIntegration());
}else{
integralCheck.setRestintegraltionbefore(new BigDecimal(0));
integralCheck.setOgintegrationbefore(new BigDecimal(0));
integralCheck.setCpintegrationbefore(new BigDecimal(0));
}
/**
* RESTINTEGRALTIONDECODE NUMBER 0 0 -1 0 0 0 0 0 VISIBLE
* OGINTEGRATIONDECODE NUMBER 0 0 -1 0 0 0 0 0 VISIBLE
* CPINTEGRATIONDECODE NUMBER 0 0 -1 0 0 0 0 0 VISIBLE
* OGINTEGRATIONADD NUMBER 0 0 -1 0 0 0 0 0 VISIBLE
* CPINTEGRATIONADD NUMBER 0 0 -1 0 0 0 0 0 VISIBLE
* RESTTEGRALTIONADD NUMBER 0 0 -1 0 0 0 0 0 VISIBLE
*/
//获取用户累加积分
integralCheck.setRestintegraltiondecode(new BigDecimal(0));
integralCheck.setOgintegrationdecode(new BigDecimal(0));
integralCheck.setCpintegrationdecode(new BigDecimal(0));
//构建表名
Map<String, Object> paramSum = new HashMap<>();
// 格式化输出(如果需要)
paramSum.put("startTime", simpleDateFormat.format(calendarYesterday.getTime()) + " 00:00:00");
paramSum.put("endTime", simpleDateFormat.format(new Date()) + " 00:00:00");
paramSum.put("userId",user.getId());
//从配置文件中读取数据库连接类型
paramSum.put("DBTYPE", PropertiesUtil.getValue("DBType"));
List<HashMap<String,Object>> sumIntegration = integrationListMapper.getUserYesterdayAddIntegation(paramSum);
if(null != sumIntegration && !sumIntegration.isEmpty()){
BigDecimal sum = (BigDecimal) sumIntegration.get(0).get("SUMPAYINTEGRATION");
integralCheck.setResttegraltionadd(sum);
integralCheck.setOgintegrationadd(sum.multiply(finalOgPercent.getValue()));
integralCheck.setCpintegrationadd(sum.multiply(finalCsPercent.getValue()));
}else{
integralCheck.setResttegraltionadd(new BigDecimal(0));
integralCheck.setOgintegrationadd(new BigDecimal(0));
integralCheck.setCpintegrationadd(new BigDecimal(0));
}
integralCheck.setOpertor("GSY");
integralCheckList.add(integralCheck);
countDownLatch.countDown();
}catch (Exception e){
e.printStackTrace();
log.info("======",e);
countDownLatch.countDown();
}
});
}
//等待子线程执行完毕
countDownLatch.await();
log.info("主线程工作结束==============");
}
log.info("处理完数据次数==="+userByInteralList.size());
solveCheckService.solveCheck(integralCheckList);
} catch (Exception e) {
log.error("接口异常了:"+e.getMessage());
e.printStackTrace();
}
}
}

@ -57,7 +57,7 @@ public class MileChangeMsgTask {
@Autowired
private WebSocketServer webSocketServer;
//@Scheduled(cron = " 0 0/1 * * * ? ")//15秒执行一次
@Scheduled(cron = " 0 0/1 * * * ? ")//15秒执行一次
@Transactional(timeout = 100)
public void MileChange() {
try {

@ -59,7 +59,7 @@ public class MileChangeTask {
@Autowired
private WebSocketServer webSocketServer;
//@Scheduled(cron = " 0 0/4 * * * ? ")//15秒执行一次
@Scheduled(cron = " 0 0/4 * * * ? ")//15秒执行一次
// @Transactional
public synchronized void MileChange() {
try {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -8,8 +8,8 @@
<title></title>
<script type="module" crossorigin src="./assets/index.15470a76.js"></script>
<link rel="stylesheet" href="./assets/index.7b041637.css">
<script type="module" crossorigin src="./assets/index.f887866c.js"></script>
<link rel="stylesheet" href="./assets/index.685b659d.css">
</head>
<body>
<div id="app">

Loading…
Cancel
Save