人员消费积分核验

master
白美平 4 months ago
parent b3f5bcdf3d
commit 2f3fefaf86

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CopilotChatHistory">
<option name="conversations">
<list>
<Conversation>
<option name="createTime" value="1754009144485" />
<option name="id" value="019863178ca57ca8b783a19d8d5598be" />
<option name="title" value="新对话 2025年8月01日 08:45:44" />
<option name="updateTime" value="1754009144485" />
</Conversation>
</list>
</option>
</component>
</project>

@ -50,4 +50,6 @@ public class IntegralCheck {
private BigDecimal cpintegrationadd; private BigDecimal cpintegrationadd;
@TableField(value = "RESTTEGRALTIONADD") @TableField(value = "RESTTEGRALTIONADD")
private BigDecimal resttegraltionadd; private BigDecimal resttegraltionadd;
@TableField(value = "OPERTOR")
private String opertor;
} }

@ -0,0 +1,12 @@
package com.nmgs.mapper.bak;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.nmgs.entity.IntegralCheck;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface IntegralCheckBakMapper extends MppBaseMapper<IntegralCheck> {
}

@ -0,0 +1,39 @@
package com.nmgs.service.impl;
import com.nmgs.entity.IntegralCheck;
import com.nmgs.mapper.bak.IntegralCheckBakMapper;
import com.nmgs.mapper.petrol.IntegralCheckMapper;
import com.nmgs.util.PropertiesUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class SolveCheckServiceImpl {
public IntegralCheckMapper integralCheckMapper;
@Autowired
public void setIntegralCheckMapper(IntegralCheckMapper integralCheckMapper) {
this.integralCheckMapper = integralCheckMapper;
}
public IntegralCheckBakMapper integralCheckBakMapper;
@Autowired
public void setIntegralCheckBakMapper(IntegralCheckBakMapper integralCheckBakMapper) {
this.integralCheckBakMapper = integralCheckBakMapper;
}
@Transactional(timeout = 1800)
public void solveCheck(List<IntegralCheck> list){
int i=1;
for(IntegralCheck integralCheck:list){
i++;
integralCheckMapper.insert(integralCheck);
if(PropertiesUtil.getValue("IsBak").equals("1")){
integralCheckBakMapper.insert(integralCheck);
}
System.out.println("次数===" + i);
}
}
}

@ -3,9 +3,9 @@ package com.nmgs.task;
import com.nmgs.entity.IntegralCheck; import com.nmgs.entity.IntegralCheck;
import com.nmgs.entity.IntegrationList; import com.nmgs.entity.IntegrationList;
import com.nmgs.entity.User; import com.nmgs.entity.User;
import com.nmgs.mapper.petrol.IntegralCheckMapper;
import com.nmgs.mapper.petrol.IntegrationListMapper; import com.nmgs.mapper.petrol.IntegrationListMapper;
import com.nmgs.mapper.petrol.UserMapper; import com.nmgs.mapper.petrol.UserMapper;
import com.nmgs.service.impl.SolveCheckServiceImpl;
import com.nmgs.util.PropertiesUtil; import com.nmgs.util.PropertiesUtil;
import com.nmgs.util.PubTools; import com.nmgs.util.PubTools;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -13,10 +13,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -41,17 +41,16 @@ public class ConsumeIntegralCheck {
public void setIntegrationListMapper(IntegrationListMapper integrationListMapper) { public void setIntegrationListMapper(IntegrationListMapper integrationListMapper) {
this.integrationListMapper = integrationListMapper; this.integrationListMapper = integrationListMapper;
} }
public IntegralCheckMapper integralCheckMapper;
public SolveCheckServiceImpl solveCheckService;
@Autowired @Autowired
public void setIntegralCheckMapper(IntegralCheckMapper integralCheckMapper) { public void setSolveCheckService(SolveCheckServiceImpl solveCheckService) {
this.integralCheckMapper = integralCheckMapper; this.solveCheckService = solveCheckService;
} }
@Scheduled(cron = " 0 0 1 * * ? ")//每日1点执行一次 @Scheduled(cron = " 0 0 11 * * ? ")//每日9点执行一次
@Transactional(timeout = 100)
public void check() { public void check() {
try { try {
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
//1、查询昨日积分有变动的人员 //1、查询昨日积分有变动的人员
Map<String,Object> params=new HashMap(); Map<String,Object> params=new HashMap();
@ -60,10 +59,10 @@ public class ConsumeIntegralCheck {
params.put("DBTYPE", PropertiesUtil.getValue("DBType")); params.put("DBTYPE", PropertiesUtil.getValue("DBType"));
List<User> selectforlist = usermapper.getUserByInteralList(params); List<User> selectforlist = usermapper.getUserByInteralList(params);
System.out.println("总人次数===" + selectforlist.size()); System.out.println("总人次数===" + selectforlist.size());
List<IntegralCheck> list=new ArrayList<>();
for (int i = 0; i < selectforlist.size(); i++) { for (int i = 0; i < selectforlist.size(); i++) {
User userIdO = selectforlist.get(i); User userIdO = selectforlist.get(i);
int userId = userIdO.getId(); int userId = userIdO.getId();
IntegralCheck integralCheck=new IntegralCheck(); IntegralCheck integralCheck=new IntegralCheck();
integralCheck.setUserId(userId); integralCheck.setUserId(userId);
integralCheck.setOpenid(userIdO.getOpenId()); integralCheck.setOpenid(userIdO.getOpenId());
@ -127,7 +126,6 @@ public class ConsumeIntegralCheck {
String PAYTYPE = integrationList2.getPayType(); String PAYTYPE = integrationList2.getPayType();
BigDecimal payIntegraltion = integrationList2.getPayIntegration(); BigDecimal payIntegraltion = integrationList2.getPayIntegration();
RESTINTEGRALTIONDECODE=RESTINTEGRALTIONDECODE.subtract(payIntegraltion); RESTINTEGRALTIONDECODE=RESTINTEGRALTIONDECODE.subtract(payIntegraltion);
boolean updateCan = false;
if ("FC".equals(PAYTYPE) || "FS".equals(PAYTYPE) || "FCA".equals(PAYTYPE)) {//商超及餐饮预约 if ("FC".equals(PAYTYPE) || "FS".equals(PAYTYPE) || "FCA".equals(PAYTYPE)) {//商超及餐饮预约
CPENABLEINTEGRATIONDECODE = CPENABLEINTEGRATIONDECODE.subtract(payIntegraltion); CPENABLEINTEGRATIONDECODE = CPENABLEINTEGRATIONDECODE.subtract(payIntegraltion);
@ -153,12 +151,16 @@ public class ConsumeIntegralCheck {
integralCheck.setOgintegrationdecode(OGENABLEINTEGRATIONDECODE); integralCheck.setOgintegrationdecode(OGENABLEINTEGRATIONDECODE);
integralCheck.setCpintegrationdecode(CPENABLEINTEGRATIONDECODE); integralCheck.setCpintegrationdecode(CPENABLEINTEGRATIONDECODE);
integralCheck.setRestintegraltiondecode(RESTINTEGRALTIONDECODE); integralCheck.setRestintegraltiondecode(RESTINTEGRALTIONDECODE);
integralCheckMapper.insert(integralCheck); integralCheck.setOpertor("BMP");
System.out.println("次数===" + i); list.add(integralCheck);
System.out.println("处理完数据次数===" + i);
} }
solveCheckService.solveCheck(list);
} catch (Exception e) { } catch (Exception e) {
System.out.println("接口异常了:"+e.getMessage());
e.printStackTrace(); e.printStackTrace();
} }
} }
} }

Loading…
Cancel
Save