Explorar o código

财务审核修改

anderx %!s(int64=2) %!d(string=hai) anos
pai
achega
c2c826ad9c

+ 1 - 0
src/main/java/com/goafanti/common/dao/TOrderExamineMapper.java

@@ -19,6 +19,7 @@ public interface TOrderExamineMapper {
     int updateByPrimaryKey(TOrderExamine record);
 
     List<TOrderExamine> selectByOrderNo(@Param("orderNo")String orderNo,@Param("type")Integer type);
+    List<TOrderExamine> selectByTid(Integer tid);
 
     void updateStatusByOrderNo(@Param("orderNo")String orderNo,@Param("aid") String aid, @Param("status")Integer status);
 

+ 23 - 6
src/main/java/com/goafanti/common/mapper/TOrderExamineMapper.xml

@@ -9,9 +9,10 @@
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="aname" jdbcType="VARCHAR" property="aname" />
     <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="tid" jdbcType="INTEGER" property="tid" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, order_no, aid, `status`, create_time, aname, `type`
+    id, order_no, aid, `status`, create_time, aname, `type`, tid
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -25,11 +26,11 @@
   </delete>
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderExamine" useGeneratedKeys="true">
     insert into t_order_examine (order_no, aid, `status`,
-      create_time, aname, `type`
-      )
+      create_time, aname, `type`,
+      tid)
     values (#{orderNo,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
-      #{createTime,jdbcType=TIMESTAMP}, #{aname,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}
-      )
+      #{createTime,jdbcType=TIMESTAMP}, #{aname,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
+      #{tid,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderExamine" useGeneratedKeys="true">
     insert into t_order_examine
@@ -52,6 +53,9 @@
       <if test="type != null">
         `type`,
       </if>
+      <if test="tid != null">
+        tid,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="orderNo != null">
@@ -72,6 +76,9 @@
       <if test="type != null">
         #{type,jdbcType=INTEGER},
       </if>
+      <if test="tid != null">
+        #{tid,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderExamine">
@@ -95,6 +102,9 @@
       <if test="type != null">
         `type` = #{type,jdbcType=INTEGER},
       </if>
+      <if test="tid != null">
+        tid = #{tid,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -105,7 +115,8 @@
       `status` = #{status,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       aname = #{aname,jdbcType=VARCHAR},
-      `type` = #{type,jdbcType=INTEGER}
+      `type` = #{type,jdbcType=INTEGER},
+      tid = #{tid,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -140,6 +151,12 @@
     from t_order_examine where status=0
     and order_no = #{orderNo} and aid= #{aid}
   </select>
+  <select id="selectByTid" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from t_order_examine
+    where tid = #{tid}
+  </select>
   <delete id="deleteByOrderNo">
     delete from t_order_examine
     where order_no = #{orderNo}

+ 22 - 1
src/main/java/com/goafanti/common/model/TOrderExamine.java

@@ -40,6 +40,11 @@ public class TOrderExamine implements Serializable {
      */
     private Integer type;
 
+    /**
+     * 会员编号
+     */
+    private Integer tid;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -98,12 +103,28 @@ public class TOrderExamine implements Serializable {
         this.type = type;
     }
 
+    public Integer getTid() {
+        return tid;
+    }
+
+    public void setTid(Integer tid) {
+        this.tid = tid;
+    }
+
     public TOrderExamine() {
     }
 
     public TOrderExamine(String orderNo,Integer type, String aid,String aname) {
         this.orderNo = orderNo;
-        this.type = type;
+        this.type=type;
+        this.aid = aid;
+        this.aname=aname;
+        this.status=0;
+    }
+    public TOrderExamine(String orderNo,Integer type,Integer tid, String aid,String aname) {
+        this.orderNo = orderNo;
+        this.type=type;
+        this.tid=tid;
         this.aid = aid;
         this.aname=aname;
         this.status=0;

+ 20 - 13
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -1443,22 +1443,24 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		tTaskMemberMapper.updateServiceYearBySplitSuper(tid);
 		addMemberLog(tOrderTask.getId(),0,"新增会员项目");
 		if(memberType!=null){
-			addMemberExamine(tOrderTask.getOrderNo());
-			addNoticMember(NoticeStatus.MENBER_START.getCode(),tOrderTask.getOrderNo(),null,0);
+			addMemberExamine(tOrderTask);
+			addNoticMember(NoticeStatus.MENBER_START.getCode(),tOrderTask,null,0);
 			addFinanceCountMember(tOrderTask.getOrderNo(),date);
 		}
 		return tb;
 	}
 
-	private void addMemberExamine(String orderNo) {
-		OrganizationListOut dep = tOrderNewMapper.selectOrderFinance(orderNo);
+
+
+	private void addMemberExamine(TOrderTask t) {
+		OrganizationListOut dep = tOrderNewMapper.selectOrderFinance(t.getOrderNo());
 		List<TOrderExamine> list=new ArrayList<>();
 		if(!Objects.isNull(dep)){
 			if (!Objects.isNull(dep.getFinanceId())){
-				list.add(new TOrderExamine(orderNo,1,dep.getFinanceId(),dep.getFinanceName()));
+				list.add(new TOrderExamine(t.getOrderNo(),1,t.getId(),dep.getFinanceId(),dep.getFinanceName()));
 			}
 			if (!Objects.isNull(dep.getRetrialFinanceId())){
-				list.add(new TOrderExamine(orderNo,1,dep.getRetrialFinanceId(),dep.getRetrialFinanceName()));
+				list.add(new TOrderExamine(t.getOrderNo(),1,t.getId(),dep.getRetrialFinanceId(),dep.getRetrialFinanceName()));
 			}
 		}
 		tOrderExamineMapper.insertBatch(list);
@@ -1482,20 +1484,25 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		}
 	}
 
-	public void addNoticMember(Integer type,  String orderNo,Integer shiroType,Integer result) {
-		TOrderNewBo tn = tOrderNewMapper.getSaleIdByOno(orderNo);
-		addNoticMember(type,tn,shiroType,result);
+
+	public void addNoticMember(Integer type,  TOrderTask tOrderTask,Integer shiroType,Integer result) {
+		TOrderNewBo tn = tOrderNewMapper.getSaleIdByOno(tOrderTask.getOrderNo());
+		addNoticMember(type,tn,shiroType,result,tOrderTask);
 	}
 
 	@Override
-	public void addNoticMember(Integer type,  TOrderNewBo b,Integer shiroType,Integer result) {
+	public void addNoticMember(Integer type, TOrderNewBo b, Integer shiroType, Integer result) {
+		addNoticMember(type,b,shiroType,result,null);
+	}
+
+	public void addNoticMember(Integer type,  TOrderNewBo b,Integer shiroType,Integer result,TOrderTask tOrderTask) {
 		StringBuffer sb=new StringBuffer();
 		String aid=null;
 		List<Admin>admins=new ArrayList<>();
 		sb.append("客户名称【").append(b.getUserName()).append("】,订单编号【").append(b.getOrderNo()).append("】,");
 		if (type.equals(NoticeStatus.MENBER_START.getCode())){
 			sb=sb.append("发起会员项目,请及时审核");
-			pushTOrderExamineAid(b.getOrderNo(),admins);
+			pushTOrderExamineAid(tOrderTask.getId(),admins);
 		}else if (type.equals(NoticeStatus.MENBER_YES.getCode())){
 			sb=sb.append("会员项目审核");
 			if(shiroType==0){
@@ -1538,8 +1545,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		}
 	}
 
-	private void pushTOrderExamineAid(String orderNo, List<Admin> admins) {
-		List<TOrderExamine> list = tOrderExamineMapper.selectByOrderNo(orderNo, 1);
+	private void pushTOrderExamineAid(Integer tid, List<Admin> admins) {
+		List<TOrderExamine> list = tOrderExamineMapper.selectByTid(tid);
 		for (TOrderExamine e : list) {
 			Admin admin = new Admin();
 			admin.setId(e.getAid());