Pārlūkot izejas kodu

修改订单搜索客户接口

anderx 1 gadu atpakaļ
vecāks
revīzija
ef7084e3ed

+ 20 - 15
src/main/java/com/goafanti/common/mapper/RestrictProjectMapper.xml

@@ -119,16 +119,7 @@
     </update>
 
 
-    <select id="selectByParam" resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List" />
-        from restrict_project
-        where aid = #{aid,jdbcType=VARCHAR}
-        and uid =#{uid,jdbcType=VARCHAR}
-          <if test="pid != null">
-            and  pid = #{pid,jdbcType=VARCHAR}
-        </if>
-    </select>
+
     <select id="selectByUidAndAid" resultType="com.goafanti.business.bo.OutRestrictProject">
         select a.id pid ,b.id,a.bname projectName,b.type,b.lock_time lockTime,b.release_time releaseTime ,
                c.nickname userName ,d.name adminName,b.create_time createTime,b.uid,b.aid
@@ -191,16 +182,30 @@
                  left join user c on b.uid=c.id left join admin d on b.aid=d.id
         where  b.aid= #{aid,jdbcType=VARCHAR}
     </select>
+    <select id="selectByParam" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from restrict_project
+        where uid =#{uid,jdbcType=VARCHAR}
+        <if test="aid != null">
+            and aid = #{aid,jdbcType=VARCHAR}
+        </if>
+        <if test="pid != null">
+            and  pid = #{pid,jdbcType=VARCHAR}
+        </if>
+    </select>
     <select id="selectListByParam" resultType="com.goafanti.common.model.RestrictProject">
         select
         <include refid="Base_Column_List" />
         from restrict_project
         where  type >0
-        and aid = #{aid,jdbcType=VARCHAR}
-        and uid =#{uid,jdbcType=VARCHAR}
-          <if test="pid !=null">
-              and  pid = #{pid,jdbcType=VARCHAR}
-          </if>
+        where uid =#{uid,jdbcType=VARCHAR}
+        <if test="aid != null">
+            and aid = #{aid,jdbcType=VARCHAR}
+        </if>
+        <if test="pid != null">
+            and  pid = #{pid,jdbcType=VARCHAR}
+        </if>
     </select>
 
     <update id="updateRelease">

+ 5 - 3
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -172,12 +172,15 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			//处理客户已派项目
 			projectDistributionPushUserMid(tn);
 			//处理限定项目状态
-			RestrictProject use = restrictProjectMapper.selectByParam(new InputRestrictProject(tn.getBuyerId(), tn.getSalesmanId(), t.getCommodityId()));
+			RestrictProject use = restrictProjectMapper.selectByParam(new InputRestrictProject(tn.getBuyerId(), null, t.getCommodityId()));
 			if (use!=null){
 				RestrictProject newRP=new RestrictProject();
 				newRP.setId(use.getId());
 				newRP.setLockTime(date);
 				newRP.setType(2);
+				if (!use.getAid().equals(tn.getSalesmanId())){
+					newRP.setAid(tn.getSalesmanId());
+				}
 				restrictProjectMapper.updateByPrimaryKeySelective(newRP);
 				UserTransferLog log=new UserTransferLog();
 				log.setAid(use.getAid());
@@ -187,10 +190,9 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 				log.setRemarks("签单触发锁定限时项目");
 				userTransferLogMapper.insertSelective(log);
 			} else {
-				restrictProjectMapper.deleteByPram(new RestrictProject(tn.getBuyerId(),t.getCommodityId()));
 				RestrictProject newRP=new RestrictProject();
 				newRP.setUid(tn.getBuyerId());
-				newRP.setAid(TokenManager.getAdminId());
+				newRP.setAid(tn.getSalesmanId());
 				newRP.setPid(t.getCommodityId());
 				newRP.setLockTime(date);
 				newRP.setType(2);