Commit b8d94d0a by 魏文甫

Merge branch 'wei_master' into '105'

Wei master

See merge request !13
2 parents 73bbaa40 b729b12c
......@@ -8,4 +8,6 @@ import java.util.Map;
*/
public interface IntegralMapper {
List<Map<String, Object>> signInList(Map<String, Object> param);
Map<String, Object> queryTodaySign(Map<String, Object> param2);
}
......@@ -54,7 +54,7 @@ public class UserServiceImpl implements UserService {
tKzyUserIntegralFlowing.setCreateDt(new Date());
tKzyUserIntegralFlowing.setSourceType(1);
tKzyUserIntegralFlowing.setType(1);
tKzyUserIntegralFlowing.setUserId(loginUser.getId());
if (loginUser.getIntegral() == null) {
loginUser.setIntegral(0);
}
......@@ -90,16 +90,27 @@ public class UserServiceImpl implements UserService {
Map<String, Object> dataMap = new HashMap<>();
dataMap.put("integral", integral);
dataMap.put("signInCount", loginUser.getSignInCount());
return ResultMapUtil.returnMap("1", "操作成功!", null);
return ResultMapUtil.returnMap("1", "操作成功!", dataMap);
}
@Override
public Map<String, Object> signInList(TKzyUser loginUser) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd");
Map<String, Object> param = new HashMap<String, Object>();
param.put("userId", loginUser.getId());
param.put("month", simpleDateFormat.format(new Date()));
List<Map<String, Object>> list = integralMapper.signInList(param);
Map<String, Object> param2 = new HashMap<String, Object>();
param2.put("userId", loginUser.getId());
param2.put("today", simpleDateFormat2.format(new Date()));
Map<String, Object> todaySign = integralMapper.queryTodaySign(param2);
Map<String, Object> dataMap = new HashMap<>();
dataMap.put("list", list);
dataMap.put("todaySign", todaySign);
return ResultMapUtil.returnMap("1", "", list);
}
......
......@@ -14,4 +14,17 @@
AND t.user_id = #{userId,jdbcType=BIGINT}
AND DATE_FORMAT(t.create_dt, '%Y-%m') = #{month,jdbcType=VARCHAR}
</select>
<select id="queryTodaySign" parameterType="java.util.HashMap" resultType="java.util.HashMap">
SELECT
t.id,
t.create_dt AS createDt,
t.integral
FROM
t_kzy_user_integral_flowing t
WHERE
t.source_type = 1
AND t.user_id = #{userId,jdbcType=BIGINT}
AND DATE_FORMAT(t.create_dt, '%Y-%m-%') = #{todya,jdbcType=VARCHAR}
limit t.id DESC limit 0,1
</select>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!