Просмотр исходного кода

Merge branch 'master' into test

anderx лет назад: 2
Родитель
Сommit
aeebbeb54f

+ 24 - 10
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -418,10 +418,11 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 	private List<AdminCustomerBo> AllDepCount(List<Department> depIds, String startTime, String endTime) {
 		List<AdminCustomerBo> admins = adminMapper.selectByDeps(depIds);
-		List<AdminCustomerBo> users = 	userMapper.selectNoChannelByaids(admins,startTime,endTime);
-		List<AdminCustomerBo> users2 = 	userMapper.selectChannelByaids(admins,startTime,endTime);
-		for (AdminCustomerBo admin : admins) {
-			for (AdminCustomerBo user : users) {
+		if(!admins.isEmpty()){
+			List<AdminCustomerBo> users = 	userMapper.selectNoChannelByaids(admins,startTime,endTime);
+			List<AdminCustomerBo> users2 = 	userMapper.selectChannelByaids(admins,startTime,endTime);
+			for (AdminCustomerBo admin : admins) {
+				for (AdminCustomerBo user : users) {
 					if (admin.getAid().equals(user.getAid())){
 						admin.setUserCount(user.getUserCount());
 						admin.setChannelCount(user.getChannelCount());
@@ -431,18 +432,31 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 						admin.setReceiveCount(user.getReceiveCount());
 						break;
 					}
-			}
-			for (AdminCustomerBo user : users2) {
-				if (admin.getAid().equals(user.getAid())){
-					admin.setCompleteCount(user.getCompleteCount());
-					admin.setChannelCompleteCount(user.getChannelCompleteCount());
-					break;
 				}
+				for (AdminCustomerBo user : users2) {
+					if (admin.getAid().equals(user.getAid())){
+						admin.setCompleteCount(user.getCompleteCount());
+						admin.setChannelCompleteCount(user.getChannelCompleteCount());
+						break;
+					}
+				}
+				pushAdminCount(admin);
 			}
 		}
 		return admins;
 	}
 
+	private void pushAdminCount(AdminCustomerBo admin) {
+		if (admin.getUserCount()==null) admin.setUserCount(0);
+		if (admin.getChannelCount()==null) admin.setChannelCount(0);
+		if (admin.getSignCount()==null) admin.setSignCount(0);
+		if (admin.getNewCount()==null) admin.setNewCount(0);
+		if (admin.getChannelNewCount()==null) admin.setChannelNewCount(0);
+		if (admin.getReceiveCount()==null) admin.setReceiveCount(0);
+		if (admin.getCompleteCount()==null) admin.setCompleteCount(0);
+		if (admin.getChannelCompleteCount()==null) admin.setChannelCompleteCount(0);
+	}
+
 	//迭代获取所有部门与部门员工并计算出部门数量
 	public List<DepCountBo> iterationDeps(String id,List<AdminCustomerBo> list) {
 		List<DepCountBo>  deps =departmentMapper.selectBysuperId(id);

+ 2 - 0
src/main/java/com/goafanti/common/dao/TOrderNewMapper.java

@@ -79,4 +79,6 @@ public interface TOrderNewMapper {
     List<TOrderNewBo> selectByuidandAid(@Param("uid")String uid,@Param("aid") String aid);
 
     List<StatisOrderList>  statisticsOrderList(InputStatistics in);
+
+    List<UserOrder>  matchingOrderNoOrUserName(@Param("orderNo") String orderNo, @Param("userName")String userName);
 }

+ 18 - 72
src/main/java/com/goafanti/common/dao/TemporaryReceivablesMapper.java

@@ -8,94 +8,40 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.ibatis.annotations.Param;
+import org.springframework.beans.factory.annotation.Value;
 
 public interface TemporaryReceivablesMapper {
-    /**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table temporary_receivables
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	long countByExample(TemporaryReceivablesExample example);
+    int deleteByPrimaryKey(Integer id);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table temporary_receivables
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	int deleteByExample(TemporaryReceivablesExample example);
+    int insert(TemporaryReceivables record);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table temporary_receivables
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	int deleteByPrimaryKey(Integer id);
+    int insertSelective(TemporaryReceivables record);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table temporary_receivables
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	int insert(TemporaryReceivables record);
+    TemporaryReceivables selectByPrimaryKey(Integer id);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table temporary_receivables
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	int insertSelective(TemporaryReceivables record);
+    int updateByPrimaryKeySelective(TemporaryReceivables record);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table temporary_receivables
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	List<TemporaryReceivables> selectByExample(TemporaryReceivablesExample example);
+    int updateByPrimaryKey(TemporaryReceivables record);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table temporary_receivables
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	TemporaryReceivables selectByPrimaryKey(Integer id);
+    int deleteByids(List<?> ids);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table temporary_receivables
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	int updateByExampleSelective(@Param("record") TemporaryReceivables record,
-			@Param("example") TemporaryReceivablesExample example);
+    int deleteByaid(String aid);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table temporary_receivables
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	int updateByExample(@Param("record") TemporaryReceivables record,
-			@Param("example") TemporaryReceivablesExample example);
+    List<TemporaryReceivables> selectByaid(@Param("aid") String aid,@Param("mergeStatus") Integer mergeStatus);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table temporary_receivables
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	int updateByPrimaryKeySelective(TemporaryReceivables record);
+    void deleteNormalByaid(String aid);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table temporary_receivables
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	int updateByPrimaryKey(TemporaryReceivables record);
 
-	int deleteByids(List<?> ids);
 
-	int deleteByaid(String aid);
+    void insertBatch(List<TemporaryReceivablesBo> list);
 
-	List<TemporaryReceivables> selectByaid(String aid);
+    void updateRepeatOrderNo(String aid);
 
-	void deleteNormalByaid(String aid);
+    String  getCountlistReceivablesAmount(Map<String, Object> parameter);
 
+    String getCountlistReceivablesTotalAmount(Map<String, Object> parameter);
 
+    int selectReceivablesNumberRepeats(TemporaryReceivables tr);
 
-	void insertBatch(List<TemporaryReceivablesBo> list);
-
-	void updateRepeatOrderNo(String aid);
-
-	String  getCountlistReceivablesAmount(Map<String, Object> parameter);
-
-	String getCountlistReceivablesTotalAmount(Map<String, Object> parameter);
-
-	int selectReceivablesNumberRepeats(TemporaryReceivables tr);
-
-}
+    void waitngMerge(@Value("list") List<Integer> list);
+}

+ 13 - 0
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -2081,5 +2081,18 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     </if>
   </select>
 
+  <select id="matchingOrderNoOrUserName" resultType="com.goafanti.order.bo.UserOrder">
+    select order_no orderNo ,buyer_id uid ,b.nickname userName
+    from t_order_new a left join `user` b on a.buyer_id =b.id
+    where 1=1
+    <if test="orderNo !=null">
+      and   order_no like concat('%',#{orderNo},'%')
+    </if>
+    <if test="userName !=null">
+      and   b.nickname like concat('%',#{userName},'%')
+    </if>
+    limit 0,20
+  </select>
+
 
 </mapper>

+ 52 - 239
src/main/java/com/goafanti/common/mapper/TemporaryReceivablesMapper.xml

@@ -2,11 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.goafanti.common.dao.TemporaryReceivablesMapper">
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.TemporaryReceivables">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
     <result column="corporate_name" jdbcType="VARCHAR" property="corporateName" />
@@ -17,160 +12,35 @@
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="financial_pay_no" jdbcType="VARCHAR" property="financialPayNo" />
+    <result column="merge_Status" jdbcType="INTEGER" property="mergeStatus" />
   </resultMap>
-  <sql id="Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
-    <where>
-      <foreach collection="oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Update_By_Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
-    <where>
-      <foreach collection="example.oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
   <sql id="Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
-    id, order_no, corporate_name, amount, receivables_time, aid, remarks, status, create_time,
-    financial_pay_no
+    id, order_no, corporate_name, amount, receivables_time, aid, remarks, `status`, create_time,
+    financial_pay_no, merge_Status
   </sql>
-  <select id="selectByExample" parameterType="com.goafanti.common.model.TemporaryReceivablesExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from temporary_receivables
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
     select
     <include refid="Base_Column_List" />
     from temporary_receivables
     where id = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
     delete from temporary_receivables
     where id = #{id,jdbcType=INTEGER}
   </delete>
-  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TemporaryReceivablesExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
-    delete from temporary_receivables
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.TemporaryReceivables">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
-    insert into temporary_receivables (id, order_no, corporate_name,
-      amount, receivables_time, aid,
-      remarks, status, create_time,
-      financial_pay_no)
-    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{corporateName,jdbcType=VARCHAR},
-      #{amount,jdbcType=DECIMAL}, #{receivablesTime,jdbcType=TIMESTAMP}, #{aid,jdbcType=VARCHAR},
-      #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
-      #{financialPayNo,jdbcType=VARCHAR})
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TemporaryReceivables" useGeneratedKeys="true">
+    insert into temporary_receivables (order_no, corporate_name, amount,
+      receivables_time, aid, remarks,
+      `status`, create_time, financial_pay_no,
+      merge_Status)
+    values (#{orderNo,jdbcType=VARCHAR}, #{corporateName,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL},
+      #{receivablesTime,jdbcType=TIMESTAMP}, #{aid,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},
+      #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{financialPayNo,jdbcType=VARCHAR},
+      #{mergeStatus,jdbcType=INTEGER})
   </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.TemporaryReceivables">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TemporaryReceivables" useGeneratedKeys="true">
     insert into temporary_receivables
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
       <if test="orderNo != null">
         order_no,
       </if>
@@ -190,7 +60,7 @@
         remarks,
       </if>
       <if test="status != null">
-        status,
+        `status`,
       </if>
       <if test="createTime != null">
         create_time,
@@ -198,11 +68,11 @@
       <if test="financialPayNo != null">
         financial_pay_no,
       </if>
+      <if test="mergeStatus != null">
+        merge_Status,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=INTEGER},
-      </if>
       <if test="orderNo != null">
         #{orderNo,jdbcType=VARCHAR},
       </if>
@@ -230,89 +100,12 @@
       <if test="financialPayNo != null">
         #{financialPayNo,jdbcType=VARCHAR},
       </if>
+      <if test="mergeStatus != null">
+        #{mergeStatus,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.goafanti.common.model.TemporaryReceivablesExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
-    select count(*) from temporary_receivables
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
-    update temporary_receivables
-    <set>
-      <if test="record.id != null">
-        id = #{record.id,jdbcType=INTEGER},
-      </if>
-      <if test="record.orderNo != null">
-        order_no = #{record.orderNo,jdbcType=VARCHAR},
-      </if>
-      <if test="record.corporateName != null">
-        corporate_name = #{record.corporateName,jdbcType=VARCHAR},
-      </if>
-      <if test="record.amount != null">
-        amount = #{record.amount,jdbcType=DECIMAL},
-      </if>
-      <if test="record.receivablesTime != null">
-        receivables_time = #{record.receivablesTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.aid != null">
-        aid = #{record.aid,jdbcType=VARCHAR},
-      </if>
-      <if test="record.remarks != null">
-        remarks = #{record.remarks,jdbcType=VARCHAR},
-      </if>
-      <if test="record.status != null">
-        status = #{record.status,jdbcType=INTEGER},
-      </if>
-      <if test="record.createTime != null">
-        create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.financialPayNo != null">
-        financial_pay_no = #{record.financialPayNo,jdbcType=VARCHAR},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
-    update temporary_receivables
-    set id = #{record.id,jdbcType=INTEGER},
-      order_no = #{record.orderNo,jdbcType=VARCHAR},
-      corporate_name = #{record.corporateName,jdbcType=VARCHAR},
-      amount = #{record.amount,jdbcType=DECIMAL},
-      receivables_time = #{record.receivablesTime,jdbcType=TIMESTAMP},
-      aid = #{record.aid,jdbcType=VARCHAR},
-      remarks = #{record.remarks,jdbcType=VARCHAR},
-      status = #{record.status,jdbcType=INTEGER},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      financial_pay_no = #{record.financialPayNo,jdbcType=VARCHAR}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TemporaryReceivables">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
     update temporary_receivables
     <set>
       <if test="orderNo != null">
@@ -334,7 +127,7 @@
         remarks = #{remarks,jdbcType=VARCHAR},
       </if>
       <if test="status != null">
-        status = #{status,jdbcType=INTEGER},
+        `status` = #{status,jdbcType=INTEGER},
       </if>
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
@@ -342,15 +135,13 @@
       <if test="financialPayNo != null">
         financial_pay_no = #{financialPayNo,jdbcType=VARCHAR},
       </if>
+      <if test="mergeStatus != null">
+        merge_Status = #{mergeStatus,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TemporaryReceivables">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 14 11:33:48 CST 2019.
-    -->
     update temporary_receivables
     set order_no = #{orderNo,jdbcType=VARCHAR},
       corporate_name = #{corporateName,jdbcType=VARCHAR},
@@ -358,9 +149,10 @@
       receivables_time = #{receivablesTime,jdbcType=TIMESTAMP},
       aid = #{aid,jdbcType=VARCHAR},
       remarks = #{remarks,jdbcType=VARCHAR},
-      status = #{status,jdbcType=INTEGER},
+      `status` = #{status,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
-      financial_pay_no = #{financialPayNo,jdbcType=VARCHAR}
+      financial_pay_no = #{financialPayNo,jdbcType=VARCHAR},
+      merge_Status = #{mergeStatus,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -380,11 +172,12 @@
     where aid = #{aid} and status &lt; 2
   </delete>
   <select id="selectByaid" resultMap="BaseResultMap">
-
     select
     <include refid="Base_Column_List" />
     from temporary_receivables
-    where aid = #{aid,jdbcType=INTEGER}
+    where aid = #{aid}
+    and merge_status= #{mergeStatus}
+
   </select>
   <select id="selectReceivablesList" parameterType="java.lang.String" resultType="com.goafanti.order.bo.ReceivablesListBo">
   	 select a.id,a.order_no orderNo,b.contract_no contractNo,a.corporate_name corporateName,c.nickname,
@@ -397,8 +190,11 @@
 	<if test="aid != null">
 	and  a.aid= #{aid}
 	</if>
+	<if test="mergeStatus != null">
+    and merge_status = #{mergeStatus}
+    </if>
 	<if test="contractNo != null">
-	b.contract_no like concat('%',#{contractNo},'%')
+	and  b.contract_no like concat('%',#{contractNo},'%')
 	</if>
 	<if test="orderNo != null">
 	and a.order_no = #{orderNo}
@@ -439,8 +235,11 @@
 	<if test="aid != null">
 	and  a.aid= #{aid}
 	</if>
+    <if test="mergeStatus != null">
+    and merge_status = #{mergeStatus}
+    </if>
 	<if test="contractNo != null">
-	b.contract_no like concat('%',#{contractNo},'%')
+	and b.contract_no like concat('%',#{contractNo},'%')
 	</if>
 	<if test="orderNo != null">
 	and a.order_no = #{orderNo}
@@ -492,6 +291,9 @@
 	<if test="corporateName != null">
 	and a.corporate_name like concat('%',#{corporateName},'%')
 	</if>
+      <if test="mergeStatus != null">
+          and a.merge_status = #{mergeStatus}
+      </if>
       <if test="orderDeps != null">
           and b.order_dep in
           <foreach close=")" collection="orderDeps" item="depId" open="(" separator=",">
@@ -532,6 +334,9 @@
 	<if test="corporateName != null">
 	and a.corporate_name like concat('%',#{corporateName},'%')
 	</if>
+        <if test="mergeStatus != null">
+            and a.merge_status = #{mergeStatus}
+        </if>
         <if test="orderDeps != null">
             and b.order_dep in
             <foreach close=")" collection="orderDeps" item="depId" open="(" separator=",">
@@ -577,4 +382,12 @@
 	and a.transaction_amount= #{amount}
 	and a.financial_pay_time= #{receivablesTime}
   </select>
+  <select id="waitngMerge">
+    update temporary_receivables
+    set merge_Status=1
+    where id in
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </select>
 </mapper>

+ 150 - 232
src/main/java/com/goafanti/common/model/TemporaryReceivables.java

@@ -1,238 +1,156 @@
 package com.goafanti.common.model;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
 
-public class TemporaryReceivables {
-
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column temporary_receivables.id
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	private Integer id;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column temporary_receivables.order_no
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	private String orderNo;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column temporary_receivables.corporate_name
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	private String corporateName;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column temporary_receivables.amount
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	private BigDecimal amount;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column temporary_receivables.receivables_time
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	private Date receivablesTime;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column temporary_receivables.aid
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	private String aid;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column temporary_receivables.remarks
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	private String remarks;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column temporary_receivables.status
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	private Integer status;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column temporary_receivables.create_time
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	private Date createTime;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column temporary_receivables.financial_pay_no
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	private String financialPayNo;
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column temporary_receivables.id
-	 * @return  the value of temporary_receivables.id
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public Integer getId() {
-		return id;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column temporary_receivables.id
-	 * @param id  the value for temporary_receivables.id
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public void setId(Integer id) {
-		this.id = id;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column temporary_receivables.order_no
-	 * @return  the value of temporary_receivables.order_no
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public String getOrderNo() {
-		return orderNo;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column temporary_receivables.order_no
-	 * @param orderNo  the value for temporary_receivables.order_no
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public void setOrderNo(String orderNo) {
-		this.orderNo = orderNo;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column temporary_receivables.corporate_name
-	 * @return  the value of temporary_receivables.corporate_name
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public String getCorporateName() {
-		return corporateName;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column temporary_receivables.corporate_name
-	 * @param corporateName  the value for temporary_receivables.corporate_name
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public void setCorporateName(String corporateName) {
-		this.corporateName = corporateName;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column temporary_receivables.amount
-	 * @return  the value of temporary_receivables.amount
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public BigDecimal getAmount() {
-		return amount;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column temporary_receivables.amount
-	 * @param amount  the value for temporary_receivables.amount
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public void setAmount(BigDecimal amount) {
-		this.amount = amount;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column temporary_receivables.receivables_time
-	 * @return  the value of temporary_receivables.receivables_time
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public Date getReceivablesTime() {
-		return receivablesTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column temporary_receivables.receivables_time
-	 * @param receivablesTime  the value for temporary_receivables.receivables_time
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public void setReceivablesTime(Date receivablesTime) {
-		this.receivablesTime = receivablesTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column temporary_receivables.aid
-	 * @return  the value of temporary_receivables.aid
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public String getAid() {
-		return aid;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column temporary_receivables.aid
-	 * @param aid  the value for temporary_receivables.aid
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public void setAid(String aid) {
-		this.aid = aid;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column temporary_receivables.remarks
-	 * @return  the value of temporary_receivables.remarks
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public String getRemarks() {
-		return remarks;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column temporary_receivables.remarks
-	 * @param remarks  the value for temporary_receivables.remarks
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public void setRemarks(String remarks) {
-		this.remarks = remarks;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column temporary_receivables.status
-	 * @return  the value of temporary_receivables.status
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column temporary_receivables.status
-	 * @param status  the value for temporary_receivables.status
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column temporary_receivables.create_time
-	 * @return  the value of temporary_receivables.create_time
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public Date getCreateTime() {
-		return createTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column temporary_receivables.create_time
-	 * @param createTime  the value for temporary_receivables.create_time
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public void setCreateTime(Date createTime) {
-		this.createTime = createTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column temporary_receivables.financial_pay_no
-	 * @return  the value of temporary_receivables.financial_pay_no
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public String getFinancialPayNo() {
-		return financialPayNo;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column temporary_receivables.financial_pay_no
-	 * @param financialPayNo  the value for temporary_receivables.financial_pay_no
-	 * @mbg.generated  Mon Oct 14 11:33:48 CST 2019
-	 */
-	public void setFinancialPayNo(String financialPayNo) {
-		this.financialPayNo = financialPayNo;
-	}
+/**
+ * temporary_receivables
+ * @author 
+ */
+public class TemporaryReceivables implements Serializable {
+    /**
+     * id
+     */
+    private Integer id;
+
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+
+    /**
+     * 公司名称
+     */
+    private String corporateName;
+
+    /**
+     * 收款金额
+     */
+    private BigDecimal amount;
+
+    /**
+     * 回款时间
+     */
+    private Date receivablesTime;
+
+    /**
+     * 人员id
+     */
+    private String aid;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     *  0正常 1重复 2收款大于总额 3未知错误
+     */
+    private Integer status;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 财务流水编号
+     */
+    private String financialPayNo;
+
+    /**
+     * 合并状态 0正常 1待合并
+     */
+    private Integer mergeStatus;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public String getCorporateName() {
+        return corporateName;
+    }
+
+    public void setCorporateName(String corporateName) {
+        this.corporateName = corporateName;
+    }
+
+    public BigDecimal getAmount() {
+        return amount;
+    }
+
+    public void setAmount(BigDecimal amount) {
+        this.amount = amount;
+    }
+
+    public Date getReceivablesTime() {
+        return receivablesTime;
+    }
+
+    public void setReceivablesTime(Date receivablesTime) {
+        this.receivablesTime = receivablesTime;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getFinancialPayNo() {
+        return financialPayNo;
+    }
+
+    public void setFinancialPayNo(String financialPayNo) {
+        this.financialPayNo = financialPayNo;
+    }
+
+    public Integer getMergeStatus() {
+        return mergeStatus;
+    }
+
+    public void setMergeStatus(Integer mergeStatus) {
+        this.mergeStatus = mergeStatus;
+    }
 }

+ 32 - 0
src/main/java/com/goafanti/order/bo/UserOrder.java

@@ -0,0 +1,32 @@
+package com.goafanti.order.bo;
+
+public class UserOrder {
+
+    private String orderNo;
+    private String uid;
+    private String userName;
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+}

+ 0 - 1
src/main/java/com/goafanti/order/controller/AdminNewOrderDunApiController.java

@@ -5,7 +5,6 @@ import javax.annotation.Resource;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.order.bo.OutSelectOrderDun;
 import com.goafanti.order.bo.OutSelectOrderDunAll;
-import com.goafanti.order.bo.OutStatisticsList;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;

+ 0 - 9
src/main/java/com/goafanti/order/controller/AdminOrderApiController.java

@@ -1,7 +1,5 @@
 package com.goafanti.order.controller;
 
-import java.util.ArrayList;
-import java.util.List;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -12,19 +10,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
 import com.goafanti.business.service.BusinessProjectService;
 import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.customer.bo.BusinessListBo;
-import com.goafanti.customer.bo.FollowBusinessBo;
 import com.goafanti.order.bo.OrderListBo;
-import com.goafanti.order.enums.AuditState;
-import com.goafanti.order.enums.CommodityType;
 import com.goafanti.order.service.OrderService;
 
 @RestController

+ 52 - 6
src/main/java/com/goafanti/order/controller/AdminOrderReceivablesApiController.java

@@ -73,6 +73,7 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
 		res.data(orderReceivablesService.addReceivables(t));
 		return res;
 	}
+
 	private Result inputCheck(TemporaryReceivablesBo t, Result res) {
 		if(StringUtils.isBlank(t.getOrderNo())){
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号编号"));
@@ -126,13 +127,14 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
 	}
 
 	@RequestMapping(value ="/listReceivables",method = RequestMethod.GET)
-	public Result listReceivables(ReceivablesListBo rl,Integer status,String adminName,String adminDeps,String orderDeps,Integer pageSize,Integer pageNo){
+	public Result listReceivables(ReceivablesListBo rl,Integer status,String adminName,String adminDeps,String orderDeps,
+								  Integer mergeStatus,Integer pageSize,Integer pageNo){
 		Result res = new Result();
 		Map<String, Object>map =new HashMap<>();
 		//列表数据
-		map.put("pagination", orderReceivablesService.listReceivables(  rl,status,adminName,  adminDeps, orderDeps, pageSize, pageNo));
+		map.put("pagination", orderReceivablesService.listReceivables(  rl,status,adminName,  adminDeps, orderDeps,mergeStatus, pageSize, pageNo));
 		//统计数据
-		map.put("count",orderReceivablesService.getCountlistReceivables(  rl,status,adminName,  adminDeps, orderDeps));
+		map.put("count",orderReceivablesService.getCountlistReceivables(  rl,status,adminName,  adminDeps, orderDeps,mergeStatus));
 		res.data(map);
 		return res;
 	}
@@ -142,11 +144,11 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
 	 *
 	 */
 	@RequestMapping(value ="/batchImport",method = RequestMethod.POST)
-	public Result batchImport(){
+	public Result batchImport(Integer mergeStatus){
 		LoggerUtils.debug(getClass(), "=========================开始批量导入===================");
 		Result res = new Result();
 		int i=0;
-		i=orderReceivablesService.batchImport();
+		i=orderReceivablesService.batchImport( mergeStatus);
 		if (i==-1) {
 			throw new BusinessException(new Error("未找到正确的回款信息。"));
 		}
@@ -217,7 +219,7 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
 		List<OrderListBo> list=(List<OrderListBo>)p.getList() ;
     	NewExcelUtil<OrderListBo>excel=new NewExcelUtil<>(OrderListBo.class);
 		 return  excel.exportExcel(list,"订单回款列表",uploadPath);
-    	}
+    }
 
     /**
 	 * 	导出开票
@@ -248,5 +250,49 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
 		 return  excel.exportExcel(list,"订单流水列表",response);
     }
 
+	@RequestMapping(value = "/waitingMerge",method = RequestMethod.POST)
+	public Result waitingMerge(String ids){
+		Result res=new Result();
+		if (ids==null||ids.isEmpty()){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"回款编号"));
+			return res;
+		}
+		res.data(orderReceivablesService.pushWaitingMerge(ids));
+		return res;
+	}
+
+	/**
+	 * 匹配
+	 * @param value 匹配数据值
+	 * @return
+	 */
+	@RequestMapping(value = "/matchingOrderNo",method = RequestMethod.GET)
+	public Result matchingOrderNo(String value){
+		Result res=new Result();
+		if (value==null){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"数据值"));
+			return res;
+		}
+		res.data(orderReceivablesService.matchingOrderNo(value));
+		return res;
+	}
+
+	/**
+	 * 匹配
+	 * @param value 匹配数据值
+	 * @return
+	 */
+	@RequestMapping(value = "/matchingUser",method = RequestMethod.GET)
+	public Result matchingUser(String value){
+		Result res=new Result();
+		if (value==null){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"数据值"));
+			return res;
+		}
+		res.data(orderReceivablesService.matchingUser(value));
+		return res;
+	}
+
+
 
 }

+ 11 - 4
src/main/java/com/goafanti/order/service/OrderReceivablesService.java

@@ -1,8 +1,12 @@
 package com.goafanti.order.service;
 
+import java.util.List;
 import java.util.Map;
 
 
+import com.goafanti.common.model.User;
+import com.goafanti.order.bo.TOrderNewBo;
+import com.goafanti.order.bo.UserOrder;
 import org.springframework.web.multipart.MultipartFile;
 
 import com.goafanti.core.mybatis.page.Pagination;
@@ -19,20 +23,23 @@ public interface OrderReceivablesService {
 
 	int deleteAllReceivables();
 
-	int batchImport();
+	int batchImport(Integer mergeStatus);
 
 
 	void batchListReceivables(MultipartFile file);
 
-	Pagination<ReceivablesListBo> listReceivables(ReceivablesListBo rl,Integer status,String adminName, String adminDeps, String orderDeps, Integer pageSize,
+	Pagination<ReceivablesListBo> listReceivables(ReceivablesListBo rl,Integer status,String adminName, String adminDeps, String orderDeps,
+												  Integer mergeStatus, Integer pageSize,
 			Integer pageNo);
 
 
 	Map<String, Object> getCountlistReceivables(ReceivablesListBo rl, Integer status, String adminName, String adminDeps,
-			String orderDeps);
-
+			String orderDeps,Integer mergeStatus);
 
 
+    int pushWaitingMerge(String ids);
 
+    List<UserOrder > matchingOrderNo(String value);
 
+	List<UserOrder > matchingUser(String value);
 }

+ 49 - 32
src/main/java/com/goafanti/order/service/impl/OrderReceivablesServiceImpl.java

@@ -1,16 +1,12 @@
 package com.goafanti.order.service.impl;
 
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
+import java.util.*;
 
 import javax.annotation.Resource;
 
 import com.goafanti.admin.service.DepartmentService;
+import com.goafanti.common.model.*;
 import com.goafanti.order.bo.*;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.Cell;
@@ -39,12 +35,6 @@ import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.dao.TemporaryReceivablesMapper;
 import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.error.BusinessException;
-import com.goafanti.common.model.TOrderBillNew;
-import com.goafanti.common.model.TOrderBonus;
-import com.goafanti.common.model.TOrderLog;
-import com.goafanti.common.model.TOrderNew;
-import com.goafanti.common.model.TOrderTask;
-import com.goafanti.common.model.TemporaryReceivables;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.ExcelUtils;
 import com.goafanti.common.utils.ExportExcelUtil;
@@ -81,13 +71,6 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 	@Autowired
 	private TOrderMidMapper	tOrderMidMapper;
 
-	@Resource
-	private FundManageOrderService fundManageOrderService;
-	@Resource
-	private OrderInvoiceService	orderInvoiceService;
-
-	@Resource
-	private OrderBillService	orderBillService;
 	@Autowired
 	private DepartmentService	departmentService;
 
@@ -122,10 +105,11 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 	public int deleteAllReceivables() {
 		return temporaryReceivablesMapper.deleteByaid(TokenManager.getAdminId());
 	}
+
 	@SuppressWarnings("deprecation")
 	@Override
-	public int batchImport() {
-		List<TemporaryReceivables> list=temporaryReceivablesMapper.selectByaid(TokenManager.getAdminId());
+	public int batchImport(Integer mergeStatus) {
+		List<TemporaryReceivables> list=temporaryReceivablesMapper.selectByaid(TokenManager.getAdminId(),mergeStatus);
 		if(list.size()>99)throw new BusinessException(new Error("数量过大,建议不超过99。"));
 		List<TOrderBillNew> listBull=new ArrayList<>();
 		for (TemporaryReceivables tr : list) {
@@ -246,15 +230,15 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 			orderNew.setSettlementAmount(count);
 			orderNew.setLiquidationStatus(lstaus);
 			tOrderNewMapper.updateByPrimaryKeySelective(orderNew);
-				//如果达到奖金发放要求新增奖金信息
-				if(null != bonus.getBonusSubject()){
+			//如果达到奖金发放要求新增奖金信息
+			if(null != bonus.getBonusSubject()){
 					bonus.setId(UUID.randomUUID().toString());
 					bonus.setGrantTarget(t.getSalesmanId());
 					//设置发放人类型
 					bonus.setGrantType(0);
 					tOrderBonusMapper.insertSelective(bonus);
 			}
-				listBull.add(tbn);
+			listBull.add(tbn);
 		}
 		if(!listBull.isEmpty()) {
 			tOrderBillNewMapper.insertBatch(listBull);
@@ -275,12 +259,12 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 	}
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<ReceivablesListBo> listReceivables(ReceivablesListBo rl,Integer status,String adminName, String adminDeps, String orderDeps, Integer pageSize,
-			Integer pageNo) {
+	public Pagination<ReceivablesListBo> listReceivables(ReceivablesListBo rl,Integer status,String adminName, String adminDeps, String orderDeps,
+														 Integer mergeStatus,Integer pageSize, Integer pageNo) {
 		Map<String,Object> parameter=new HashMap<String, Object>();
 		if(pageSize==null||pageSize<1)pageSize=10;
 		if(pageNo==null||pageNo<1)pageNo=1;
-		addParemeter(rl, status, adminName, adminDeps, orderDeps, parameter);
+		addParemeter(rl, status, adminName, adminDeps, orderDeps,mergeStatus, parameter);
 		Pagination<ReceivablesListBo> p=(Pagination<ReceivablesListBo>) findPage("selectReceivablesList", "selectReceivablesCount", parameter, pageNo, pageSize);
 		List<ReceivablesListBo> list=(List<ReceivablesListBo>) p.getList();
 
@@ -301,7 +285,8 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 		return p;
 	}
 
-	private void addParemeter(ReceivablesListBo rl, Integer status, String adminName, String adminDeps, String orderDeps, Map<String, Object> parameter) {
+	private void addParemeter(ReceivablesListBo rl, Integer status, String adminName, String adminDeps, String orderDeps,
+			Integer mergeStatus,Map<String, Object> parameter) {
 		if(StringUtils.isNotBlank(rl.getContractNo())) parameter.put("contractNo", rl.getContractNo());
 		if(StringUtils.isNotBlank(rl.getOrderNo())) parameter.put("orderNo", rl.getOrderNo());
 		if(StringUtils.isNotBlank(rl.getNickname())) parameter.put("nickname", rl.getNickname());
@@ -313,15 +298,16 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 		if(StringUtils.isNotBlank(orderDeps)){
 			parameter.put("orderDeps", departmentService.parseArray(orderDeps));
 		}
-		if(null!= status) parameter.put("status", status);
+		if(null == status) parameter.put("status", status);
+		if(null!= mergeStatus) parameter.put("mergeStatus", mergeStatus);
 		if(StringUtils.isNotBlank(TokenManager.getAdminId())) parameter.put("aid", TokenManager.getAdminId());
 	}
 
 	@Override
 	public Map<String, Object> getCountlistReceivables(ReceivablesListBo rl, Integer status, String adminName,
-			String adminDeps, String orderDeps) {
+			String adminDeps, String orderDeps,Integer mergeStatus) {
 		Map<String,Object> parameter=new HashMap<String, Object>();
-		addParemeter(rl, status, adminName, adminDeps, orderDeps, parameter);
+		addParemeter(rl, status, adminName, adminDeps, orderDeps, mergeStatus, parameter);
 		//计算回收表的订单总金额与当前总收款额。
 		Map<String,Object> map=new HashMap<String, Object>();
 		map.put("totalAmount", new BigDecimal(temporaryReceivablesMapper.getCountlistReceivablesTotalAmount(parameter)).stripTrailingZeros() );
@@ -393,31 +379,41 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 	        	TemporaryReceivablesBo trb=new TemporaryReceivablesBo();
 		        for(int cellNum = (firstCellNum); cellNum < lastCellNum;cellNum++){
 			        Cell cell = row.getCell(cellNum);
+			        String str=null;
 			    	try {
 			        switch (cellNum) {
 					case 0:
+						str="流水号";
 						trb.setFinancialPayNo(ExcelUtils.getCellValue(cell));
 						break;
 					case 1:
+						str="订单编号";
 						trb.setOrderNo(ExcelUtils.getCellValue(cell).trim());
 						break;
 					case 2:
+						str="客户名称";
 						trb.setCorporateName(ExcelUtils.getCellValue(cell));
 						break;
 					case 3:
+						str="回收款";
 						trb.setAmount(new BigDecimal((ExcelUtils.getCellValue(cell).equals("")?"0":ExcelUtils.getCellValue(cell))));
 						break;
 					case 4:
+						str="回款时间";
 						trb.setReceivablesTime(DateUtils.StringToDate(ExcelUtils.getCellValue(cell), AFTConstants.YYYYMMDD));
 						break;
 					case 5:
+						str="备注";
 						trb.setRemarks(ExcelUtils.getCellValue(cell));
 						break;
 					}
 			    	} catch (Exception e) {
-			    		throw new BusinessException(new Error("表格第"+(rowNum+1)+"行输入内容不正确。"));
+			    		throw new BusinessException(new Error("表格第"+(rowNum+1)+"行【"+str+"】内容不正确。"));
 					}
 		        }
+		        if (trb.getOrderNo()==null){
+					throw new BusinessException(new Error("表格第"+(rowNum+1)+"行【订单编号】必须输入。"));
+				}
 		        trb.setAid(TokenManager.getAdminId());
 		        trb.setCreateTime(new Date());
 		        trb.setStatus(0);
@@ -582,5 +578,26 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 		}
 
 
+	@Override
+	public int pushWaitingMerge(String ids) {
+		String[] split = ids.split(",");
+		List<String> list= Arrays.asList(split);
+		List<Integer> intList=new ArrayList<>();
+		list.forEach(e ->{
+			intList.add(Integer.valueOf(e));
+		});
+		temporaryReceivablesMapper.waitngMerge(intList);
+		return 1;
+	}
+
+	@Override
+	public List<UserOrder> matchingOrderNo(String value) {
+		return tOrderNewMapper.matchingOrderNoOrUserName(value,null);
+	}
+
+	@Override
+	public List<UserOrder> matchingUser(String value) {
+		return tOrderNewMapper.matchingOrderNoOrUserName(null,value);
+	}
 
 }

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -52,7 +52,7 @@ yxjl_max=100
 amb.maxLvl=6
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.63
+static.host=//static.jishutao.com/1.2.64
 rd.static.host=//static.jishutao.com/RD/1.0.00
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.62

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -49,7 +49,7 @@ yxjl_max=100
 
 amb.maxLvl=6
 
-static.host=//static.jishutao.com/1.2.63
+static.host=//static.jishutao.com/1.2.64
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 rd.static.host=//static.jishutao.com/RD/1.0.00