昨日消耗账分
This commit is contained in:
parent
73bd8df9da
commit
51621e5705
|
@ -1,5 +1,8 @@
|
|||
package com.ruoyi.business.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -74,6 +77,17 @@ public class BusAgentInfoController extends BaseController
|
|||
busStoreInfo.setBindUser(bean.getAgentAccount());
|
||||
List<BusStoreInfo> ll = iBusStoreInfoService.selectBusStoreInfoList(busStoreInfo);
|
||||
bean.setGrantStoreNum(ll.size());
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DAY_OF_MONTH,-1);
|
||||
Date minusDay = calendar.getTime();
|
||||
String date = sdf.format(minusDay);
|
||||
String startTime = date+" 00:00:00";
|
||||
String endTime = date+" 23:59:59";
|
||||
int lastUserIntegralNum = iBusStoreInfoService.lastUserIntegralNum(busAgentInfo.getAgentAccount(),startTime,endTime);
|
||||
bean.setLastUseIntegralNum(lastUserIntegralNum);
|
||||
|
||||
List<BusStoreInfo> lll = ll.stream().filter(f -> "1".equals(f.getReturnVisitStatus())).collect(Collectors.toList());
|
||||
bean.setOperateStoreNum(lll.size());
|
||||
SysUser user1 = iSysUserService.selectUserById(bean.getId());
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.business.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.BusStoreInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 店铺信息Mapper接口
|
||||
|
@ -26,6 +27,7 @@ public interface BusStoreInfoMapper
|
|||
* @return 店铺信息集合
|
||||
*/
|
||||
public List<BusStoreInfo> selectBusStoreInfoList(BusStoreInfo busStoreInfo);
|
||||
int lastUserIntegralNum(@Param("agentAccount") String agentAccount,@Param("startTime") String startTime,@Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 新增店铺信息
|
||||
|
|
|
@ -36,6 +36,7 @@ public interface IBusStoreInfoService
|
|||
* @return 店铺信息集合
|
||||
*/
|
||||
public List<BusStoreInfo> selectBusStoreInfoList(BusStoreInfo busStoreInfo);
|
||||
int lastUserIntegralNum(String agentAccount,String startTime,String endTime);
|
||||
|
||||
/**
|
||||
* 新增店铺信息
|
||||
|
|
|
@ -43,6 +43,8 @@ public class AiServiceImpl implements IAiService
|
|||
@Autowired
|
||||
private IBusFifteenInfoService fifteenInfoService;
|
||||
@Autowired
|
||||
private IBusIntegralRecordService integralRecordService;
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
|
||||
private String userSn = "SYSUSER|8398f13f3feccef770ee4d465fe22fbf";
|
||||
|
@ -302,6 +304,14 @@ public class AiServiceImpl implements IAiService
|
|||
int reduce = busAgentInfo.getIntegral() - a;
|
||||
busAgentInfo.setIntegral(reduce);
|
||||
agentInfoService.updateBusAgentInfo(busAgentInfo);
|
||||
|
||||
BusIntegralRecord record = new BusIntegralRecord();
|
||||
record.setAccount(busAgentInfo.getAgentAccount());
|
||||
record.setIntegralUpdateTime(new Date());
|
||||
record.setUpdateType("消耗账分");
|
||||
record.setIntegralUpdateNum(a);
|
||||
record.setIntegralBalance(reduce);
|
||||
integralRecordService.updateBusIntegralRecord(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,6 +63,11 @@ public class BusStoreInfoServiceImpl implements IBusStoreInfoService
|
|||
return busStoreInfoMapper.selectBusStoreInfoList(busStoreInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int lastUserIntegralNum(String agentAccount,String startTime,String endTime){
|
||||
return busStoreInfoMapper.lastUserIntegralNum(agentAccount, startTime, endTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增店铺信息
|
||||
*
|
||||
|
|
|
@ -32,6 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select id, platform_type, store_code, store_name, store_account, store_password, store_cookie, store_belong, grant_status, return_visit_status, bind_id, bind_user, bind_time, update_id, update_user, update_time, self_delivery_status, return_visit_user_range, sale_bind_id, sale_bind_name, sale_bind_time from bus_store_info
|
||||
</sql>
|
||||
|
||||
<select id="lastUserIntegralNum" parameterType="java.lang.String" resultType="java.lang.Integer">
|
||||
select count(integral_update_num) from bus_integral_record
|
||||
where account = #{agentAccount} and update_type = '消耗账分'
|
||||
and internal_update_time between #{startTime} and #{endTime}
|
||||
</select>
|
||||
|
||||
<select id="selectBusStoreInfoList" parameterType="BusStoreInfo" resultMap="BusStoreInfoResult">
|
||||
<include refid="selectBusStoreInfoVo"/>
|
||||
<where>
|
||||
|
|
Loading…
Reference in New Issue