浏览代码

未开启缴费,登录统计数据

周箭河 5 年之前
父节点
当前提交
808e4ee7c3

+ 4 - 4
src/main/java/com/ym/mec/collectfee/controller/UserController.java

@@ -8,6 +8,7 @@ import java.util.Map;
 
 import javax.servlet.http.HttpSession;
 
+import com.ym.mec.collectfee.service.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.dao.DuplicateKeyException;
@@ -27,10 +28,6 @@ import com.ym.mec.collectfee.entity.MecUserInfo;
 import com.ym.mec.collectfee.entity.MusicTeamsPageInfo;
 import com.ym.mec.collectfee.entity.School;
 import com.ym.mec.collectfee.entity.StudentsQueryInfo;
-import com.ym.mec.collectfee.service.ApplyInfoService;
-import com.ym.mec.collectfee.service.CourseGroupInfoService;
-import com.ym.mec.collectfee.service.OrderService;
-import com.ym.mec.collectfee.service.SchoolService;
 import com.ym.mec.collectfee.utils.Constants;
 
 @RestController()
@@ -46,6 +43,8 @@ public class UserController extends BaseController {
     private OrderService orderService;
     @Autowired
     private CourseGroupInfoService courseGroupInfoService;
+    @Autowired
+    private PayStatisService payStatisService;
 
 
     /**
@@ -81,6 +80,7 @@ public class UserController extends BaseController {
             }
             if (userByPhone != null) {
                 userByPhone.setPushStatus(school.getStatus());
+                payStatisService.addStatis(userByPhone.getId(),school.getBranchId(),clazzId,school.getName(),school.getStatus());
             }
         }
         return succeed(userByPhone);

+ 14 - 0
src/main/java/com/ym/mec/collectfee/dao/PayStatisDao.java

@@ -0,0 +1,14 @@
+package com.ym.mec.collectfee.dao;
+
+import com.ym.mec.collectfee.common.dao.BaseDAO;
+import com.ym.mec.collectfee.entity.Branch;
+import com.ym.mec.collectfee.entity.PayStatis;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public interface PayStatisDao extends BaseDAO<Integer, PayStatis> {
+
+}

+ 87 - 0
src/main/java/com/ym/mec/collectfee/entity/PayStatis.java

@@ -0,0 +1,87 @@
+package com.ym.mec.collectfee.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 对应数据库表(account):
+ */
+public class PayStatis {
+
+	/** id */
+	private Integer id;
+	//用户id
+	private Integer userId;
+	//分部id
+	private Integer branchId;
+	//乐团编号
+	private Integer classId;
+	//乐团名称
+	private String poName;
+	//声部名称
+	private String voicyPart;
+	//创建时间
+	private Date createTime;
+
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public Integer getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Integer userId) {
+		this.userId = userId;
+	}
+	public void setBranchId(Integer branchId){
+		this.branchId = branchId;
+	}
+
+	public Integer getBranchId(){
+		return this.branchId;
+	}
+
+	public Integer getClassId() {
+		return classId;
+	}
+
+	public void setClassId(Integer classId) {
+		this.classId = classId;
+	}
+
+	public String getPoName() {
+		return poName;
+	}
+
+	public void setPoName(String poName) {
+		this.poName = poName;
+	}
+
+	public String getVoicyPart() {
+		return voicyPart;
+	}
+
+	public void setVoicyPart(String voicyPart) {
+		this.voicyPart = voicyPart;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+}

+ 12 - 0
src/main/java/com/ym/mec/collectfee/service/PayStatisService.java

@@ -0,0 +1,12 @@
+package com.ym.mec.collectfee.service;
+
+import com.ym.mec.collectfee.common.service.BaseService;
+import com.ym.mec.collectfee.entity.Account;
+import com.ym.mec.collectfee.entity.PayStatis;
+
+import java.math.BigDecimal;
+
+public interface PayStatisService extends BaseService<Integer, PayStatis> {
+
+    Long addStatis(Integer userId,Integer branchId,Integer classId,String poName,Integer status);
+}

+ 41 - 0
src/main/java/com/ym/mec/collectfee/service/impl/PayStatisServiceImpl.java

@@ -0,0 +1,41 @@
+package com.ym.mec.collectfee.service.impl;
+
+import com.ym.mec.collectfee.common.dao.BaseDAO;
+import com.ym.mec.collectfee.common.service.impl.BaseServiceImpl;
+import com.ym.mec.collectfee.dao.BranchDao;
+import com.ym.mec.collectfee.dao.PayStatisDao;
+import com.ym.mec.collectfee.entity.Branch;
+import com.ym.mec.collectfee.entity.PayStatis;
+import com.ym.mec.collectfee.service.BranchService;
+import com.ym.mec.collectfee.service.PayStatisService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+@Service
+public class PayStatisServiceImpl extends BaseServiceImpl<Integer, PayStatis> implements PayStatisService {
+
+    @Autowired
+    private PayStatisDao payStatisDao;
+
+    @Override
+    public BaseDAO<Integer, PayStatis> getDAO() {
+        return payStatisDao;
+    }
+
+    @Override
+    public Long addStatis(Integer userId, Integer branchId, Integer classId, String poName, Integer status) {
+        if (!status.equals(1)) {
+            return null;
+        }
+        PayStatis payStatis = new PayStatis();
+        payStatis.setUserId(userId);
+        payStatis.setBranchId(branchId);
+        payStatis.setClassId(classId);
+        payStatis.setPoName(poName);
+        payStatis.setCreateTime(new Date());
+        return payStatisDao.insert(payStatis);
+    }
+}

+ 26 - 0
src/main/resources/config/mybatis/PayStatisMapper.xml

@@ -0,0 +1,26 @@
+<?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.ym.mec.collectfee.dao.PayStatisDao">
+
+    <resultMap type="com.ym.mec.collectfee.entity.PayStatis" id="PayStatis">
+        <result column="id" property="id"/>
+        <result column="user_id" property="userId"/>
+        <result column="branch_id" property="branchId"/>
+        <result column="class_id" property="classId"/>
+        <result column="po_name" property="poName"/>
+        <result column="voicy_part" property="voicyPart"/>
+        <result column="create_time" property="createTime"/>
+    </resultMap>
+
+    <!-- 向数据库增加一条记录 -->
+    <insert id="insert" parameterType="com.ym.mec.collectfee.entity.PayStatis" useGeneratedKeys="true" keyColumn="id"
+            keyProperty="id">
+        INSERT INTO pay_statis (id,user_id,branch_id,class_id,po_name,voicy_part,create_time)
+        VALUES (#{id},#{userId},#{branchId},#{classId},#{poName},#{voicyPart},#{createTime})
+    </insert>
+
+</mapper>