Browse Source

统计修改外出打卡,签单时增加状态

anderx 4 years ago
parent
commit
640e9a09ff

+ 1 - 1
.idea/artifacts/kede_server_war_exploded.xml

@@ -1,6 +1,6 @@
 <component name="ArtifactManager">
   <artifact type="exploded-war" build-on-make="true" name="kede-server:war exploded">
-    <output-path>$PROJECT_DIR$/out</output-path>
+    <output-path>$PROJECT_DIR$/target/kede-server-1.0.0-BUILD-SNAPSHOT</output-path>
     <properties id="maven-jee-properties">
       <options>
         <exploded>true</exploded>

+ 3 - 1
src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java

@@ -7,7 +7,8 @@ import org.apache.ibatis.annotations.Param;
 import com.goafanti.common.model.PublicRelease;
 import com.goafanti.weChat.bo.OutPublicRelease;
 
-public interface PublicReleaseMapper {int deleteByPrimaryKey(Integer id);
+public interface PublicReleaseMapper {
+    int deleteByPrimaryKey(Integer id);
 
     int insert(PublicRelease record);
 
@@ -25,4 +26,5 @@ public interface PublicReleaseMapper {int deleteByPrimaryKey(Integer id);
 
 	int checkTime(@Param("aid")String aid,@Param("start")Date start, @Param("end")Date end);
 
+    void updateSignByAidAndUid(@Param("uid") String buyerId, @Param("aid") String salesmanId);
 }

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

@@ -299,5 +299,4 @@ public interface UserMapper {
 	List<CustomerListOut> selectPrivateOrganizationCustomerList(Map<String,Object> map);
 
 
-    int checkNewUser(String uid);
 }

+ 80 - 38
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -23,14 +23,16 @@
     <result column="duration" jdbcType="DOUBLE" property="duration" />
     <result column="valid_date" jdbcType="VARCHAR" property="validDate" />
     <result column="new_user" jdbcType="INTEGER" property="newUser" />
+    <result column="sign_sum" jdbcType="INTEGER" property="signSum" />
+    <result column="main_status" jdbcType="INTEGER" property="mainStatus" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, `uid`, aid, release_start, release_end, remarks, annex_url, user_name, longitude,
-    latitude, `status`, create_time, clock_in, clock_in_time, photo_url, pid, pname,
-    ufid, duration, valid_date, new_user
+    id, `uid`, aid, release_start, release_end, remarks, annex_url, user_name, longitude, 
+    latitude, `status`, create_time, clock_in, clock_in_time, photo_url, pid, pname, 
+    ufid, duration, valid_date, new_user, sign_sum, main_status
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select
+    select 
     <include refid="Base_Column_List" />
     from public_release
     where id = #{id,jdbcType=INTEGER}
@@ -40,20 +42,22 @@
     where id = #{id,jdbcType=INTEGER}
   </delete>
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
-    insert into public_release (`uid`, aid, release_start,
-                                release_end, remarks, annex_url,
-                                user_name, longitude, latitude,
-                                `status`, create_time, clock_in,
-                                clock_in_time, photo_url, pid,
-                                pname, ufid, duration,
-                                valid_date, new_user)
-    values (#{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{releaseStart,jdbcType=TIMESTAMP},
-            #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR},
-            #{userName,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR},
-            #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{clockIn,jdbcType=INTEGER},
-            #{clockInTime,jdbcType=TIMESTAMP}, #{photoUrl,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR},
-            #{pname,jdbcType=VARCHAR}, #{ufid,jdbcType=VARCHAR}, #{duration,jdbcType=DOUBLE},
-            #{validDate,jdbcType=VARCHAR}, #{newUser,jdbcType=INTEGER})
+    insert into public_release (`uid`, aid, release_start, 
+      release_end, remarks, annex_url, 
+      user_name, longitude, latitude, 
+      `status`, create_time, clock_in, 
+      clock_in_time, photo_url, pid, 
+      pname, ufid, duration, 
+      valid_date, new_user, sign_sum, 
+      main_status)
+    values (#{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{releaseStart,jdbcType=TIMESTAMP}, 
+      #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, 
+      #{userName,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, 
+      #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{clockIn,jdbcType=INTEGER}, 
+      #{clockInTime,jdbcType=TIMESTAMP}, #{photoUrl,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, 
+      #{pname,jdbcType=VARCHAR}, #{ufid,jdbcType=VARCHAR}, #{duration,jdbcType=DOUBLE}, 
+      #{validDate,jdbcType=VARCHAR}, #{newUser,jdbcType=INTEGER}, #{signSum,jdbcType=INTEGER}, 
+      #{mainStatus,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
     insert into public_release
@@ -118,6 +122,12 @@
       <if test="newUser != null">
         new_user,
       </if>
+      <if test="signSum != null">
+        sign_sum,
+      </if>
+      <if test="mainStatus != null">
+        main_status,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="uid != null">
@@ -180,6 +190,12 @@
       <if test="newUser != null">
         #{newUser,jdbcType=INTEGER},
       </if>
+      <if test="signSum != null">
+        #{signSum,jdbcType=INTEGER},
+      </if>
+      <if test="mainStatus != null">
+        #{mainStatus,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicRelease">
@@ -245,34 +261,48 @@
       <if test="newUser != null">
         new_user = #{newUser,jdbcType=INTEGER},
       </if>
+      <if test="signSum != null">
+        sign_sum = #{signSum,jdbcType=INTEGER},
+      </if>
+      <if test="mainStatus != null">
+        main_status = #{mainStatus,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PublicRelease">
     update public_release
     set `uid` = #{uid,jdbcType=VARCHAR},
-        aid = #{aid,jdbcType=VARCHAR},
-        release_start = #{releaseStart,jdbcType=TIMESTAMP},
-        release_end = #{releaseEnd,jdbcType=TIMESTAMP},
-        remarks = #{remarks,jdbcType=VARCHAR},
-        annex_url = #{annexUrl,jdbcType=VARCHAR},
-        user_name = #{userName,jdbcType=VARCHAR},
-        longitude = #{longitude,jdbcType=VARCHAR},
-        latitude = #{latitude,jdbcType=VARCHAR},
-        `status` = #{status,jdbcType=INTEGER},
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-        clock_in = #{clockIn,jdbcType=INTEGER},
-        clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
-        photo_url = #{photoUrl,jdbcType=VARCHAR},
-        pid = #{pid,jdbcType=VARCHAR},
-        pname = #{pname,jdbcType=VARCHAR},
-        ufid = #{ufid,jdbcType=VARCHAR},
-        duration = #{duration,jdbcType=DOUBLE},
-        valid_date = #{validDate,jdbcType=VARCHAR},
-        new_user = #{newUser,jdbcType=INTEGER}
+      aid = #{aid,jdbcType=VARCHAR},
+      release_start = #{releaseStart,jdbcType=TIMESTAMP},
+      release_end = #{releaseEnd,jdbcType=TIMESTAMP},
+      remarks = #{remarks,jdbcType=VARCHAR},
+      annex_url = #{annexUrl,jdbcType=VARCHAR},
+      user_name = #{userName,jdbcType=VARCHAR},
+      longitude = #{longitude,jdbcType=VARCHAR},
+      latitude = #{latitude,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      clock_in = #{clockIn,jdbcType=INTEGER},
+      clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
+      photo_url = #{photoUrl,jdbcType=VARCHAR},
+      pid = #{pid,jdbcType=VARCHAR},
+      pname = #{pname,jdbcType=VARCHAR},
+      ufid = #{ufid,jdbcType=VARCHAR},
+      duration = #{duration,jdbcType=DOUBLE},
+      valid_date = #{validDate,jdbcType=VARCHAR},
+      new_user = #{newUser,jdbcType=INTEGER},
+      sign_sum = #{signSum,jdbcType=INTEGER},
+      main_status = #{mainStatus,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
-    <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
+  <update id="updateSignByAidAndUid">
+    update public_release a ,(select max(create_time)create_time from public_release
+      where aid= #{aid} and uid=#{uid} and main_status =1 group by aid,uid)b
+    set a.sign_sum =a.sign_sum +1
+    where a.aid =#{aid} and a.uid =#{uid} and a.main_status =1 and a.create_time =b.create_time
+  </update>
+  <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
     insert into public_release
       <trim prefix="(" suffix=")" suffixOverrides=",">
         <if test="uid != null">
@@ -335,6 +365,12 @@
         <if test="newUser != null">
           new_user,
         </if>
+        <if test="signSum != null">
+          sign_sum,
+        </if>
+        <if test="mainStatus != null">
+          main_status,
+        </if>
       </trim>
       <trim prefix="values (" suffix=")" suffixOverrides=",">
         <if test="uid != null">
@@ -397,6 +433,12 @@
         <if test="newUser != null">
           #{newUser,jdbcType=INTEGER},
         </if>
+        <if test="signSum != null">
+          #{signSum,jdbcType=INTEGER},
+        </if>
+        <if test="mainStatus != null">
+          #{mainStatus,jdbcType=INTEGER},
+        </if>
       </trim>
     <selectKey keyProperty="id" order="AFTER" resultType="int">
         SELECT LAST_INSERT_ID()

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

@@ -45,16 +45,16 @@
     <result column="new_user" jdbcType="INTEGER" property="newUser" />
   </resultMap>
   <sql id="Base_Column_List">
-    order_no, order_type, creater, create_time, update_time, buyer_id, first_amount,
-    total_amount, settlement_amount, refund_amount, order_status, liquidation_status,
-    process_status, project_status, approval, order_remarks, delete_sign, salesman_id,
-    finance_id, technician_id, sign_time, settlement_time, contract_picture_url, contract_no,
-    contract_type, contacts, contact_mobile, legal_person, legal_person_tel, proof_count,
-    proof_aid, proof_time, proof_status, order_dep, outsource, additional_order, primary_order,
+    order_no, order_type, creater, create_time, update_time, buyer_id, first_amount, 
+    total_amount, settlement_amount, refund_amount, order_status, liquidation_status, 
+    process_status, project_status, approval, order_remarks, delete_sign, salesman_id, 
+    finance_id, technician_id, sign_time, settlement_time, contract_picture_url, contract_no, 
+    contract_type, contacts, contact_mobile, legal_person, legal_person_tel, proof_count, 
+    proof_aid, proof_time, proof_status, order_dep, outsource, additional_order, primary_order, 
     old_salesman_id, back_status, agreement_url, new_user
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select
+    select 
     <include refid="Base_Column_List" />
     from t_order_new
     where order_no = #{orderNo,jdbcType=VARCHAR}
@@ -64,33 +64,33 @@
     where order_no = #{orderNo,jdbcType=VARCHAR}
   </delete>
   <insert id="insert" keyColumn="order_no" keyProperty="orderNo" parameterType="com.goafanti.common.model.TOrderNew" useGeneratedKeys="true">
-    insert into t_order_new (order_no,order_type, creater, create_time,
-      update_time, buyer_id, first_amount,
-      total_amount, settlement_amount, refund_amount,
-      order_status, liquidation_status, process_status,
-      project_status, approval, order_remarks,
-      delete_sign, salesman_id, finance_id,
-      technician_id, sign_time, settlement_time,
-      contract_picture_url, contract_no, contract_type,
-      contacts, contact_mobile, legal_person,
-      legal_person_tel, proof_count, proof_aid,
-      proof_time, proof_status, order_dep,
-      outsource, additional_order, primary_order,
-      old_salesman_id, back_status, agreement_url,
+    insert into t_order_new (order_type, creater, create_time,
+      update_time, buyer_id, first_amount, 
+      total_amount, settlement_amount, refund_amount, 
+      order_status, liquidation_status, process_status, 
+      project_status, approval, order_remarks, 
+      delete_sign, salesman_id, finance_id, 
+      technician_id, sign_time, settlement_time, 
+      contract_picture_url, contract_no, contract_type, 
+      contacts, contact_mobile, legal_person, 
+      legal_person_tel, proof_count, proof_aid, 
+      proof_time, proof_status, order_dep, 
+      outsource, additional_order, primary_order, 
+      old_salesman_id, back_status, agreement_url, 
       new_user)
-    values (#{orderNo,jdbcType=INTEGER},#{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
-      #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR}, #{firstAmount,jdbcType=DECIMAL},
-      #{totalAmount,jdbcType=DECIMAL}, #{settlementAmount,jdbcType=DECIMAL}, #{refundAmount,jdbcType=DECIMAL},
-      #{orderStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER}, #{processStatus,jdbcType=INTEGER},
-      #{projectStatus,jdbcType=INTEGER}, #{approval,jdbcType=INTEGER}, #{orderRemarks,jdbcType=VARCHAR},
-      #{deleteSign,jdbcType=INTEGER}, #{salesmanId,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR},
-      #{technicianId,jdbcType=VARCHAR}, #{signTime,jdbcType=DATE}, #{settlementTime,jdbcType=DATE},
-      #{contractPictureUrl,jdbcType=VARCHAR}, #{contractNo,jdbcType=VARCHAR}, #{contractType,jdbcType=VARCHAR},
-      #{contacts,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{legalPerson,jdbcType=VARCHAR},
-      #{legalPersonTel,jdbcType=VARCHAR}, #{proofCount,jdbcType=FLOAT}, #{proofAid,jdbcType=VARCHAR},
-      #{proofTime,jdbcType=TIMESTAMP}, #{proofStatus,jdbcType=INTEGER}, #{orderDep,jdbcType=VARCHAR},
-      #{outsource,jdbcType=INTEGER}, #{additionalOrder,jdbcType=VARCHAR}, #{primaryOrder,jdbcType=VARCHAR},
-      #{oldSalesmanId,jdbcType=VARCHAR}, #{backStatus,jdbcType=INTEGER}, #{agreementUrl,jdbcType=VARCHAR},
+    values (#{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR}, #{firstAmount,jdbcType=DECIMAL}, 
+      #{totalAmount,jdbcType=DECIMAL}, #{settlementAmount,jdbcType=DECIMAL}, #{refundAmount,jdbcType=DECIMAL}, 
+      #{orderStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER}, #{processStatus,jdbcType=INTEGER}, 
+      #{projectStatus,jdbcType=INTEGER}, #{approval,jdbcType=INTEGER}, #{orderRemarks,jdbcType=VARCHAR}, 
+      #{deleteSign,jdbcType=INTEGER}, #{salesmanId,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR}, 
+      #{technicianId,jdbcType=VARCHAR}, #{signTime,jdbcType=DATE}, #{settlementTime,jdbcType=DATE}, 
+      #{contractPictureUrl,jdbcType=VARCHAR}, #{contractNo,jdbcType=VARCHAR}, #{contractType,jdbcType=VARCHAR}, 
+      #{contacts,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{legalPerson,jdbcType=VARCHAR}, 
+      #{legalPersonTel,jdbcType=VARCHAR}, #{proofCount,jdbcType=FLOAT}, #{proofAid,jdbcType=VARCHAR}, 
+      #{proofTime,jdbcType=TIMESTAMP}, #{proofStatus,jdbcType=INTEGER}, #{orderDep,jdbcType=VARCHAR}, 
+      #{outsource,jdbcType=INTEGER}, #{additionalOrder,jdbcType=VARCHAR}, #{primaryOrder,jdbcType=VARCHAR}, 
+      #{oldSalesmanId,jdbcType=VARCHAR}, #{backStatus,jdbcType=INTEGER}, #{agreementUrl,jdbcType=VARCHAR}, 
       #{newUser,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" keyColumn="order_no" keyProperty="orderNo" parameterType="com.goafanti.common.model.TOrderNew" useGeneratedKeys="true">

+ 0 - 3
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -1855,7 +1855,4 @@
     </if>
   </select>
 
-  <select id="checkNewUser" resultType="java.lang.Integer">
-    select max(new_user) from t_order_new where buyer_id = #{uid}
-  </select>
 </mapper>

+ 26 - 0
src/main/java/com/goafanti/common/model/PublicRelease.java

@@ -110,6 +110,16 @@ public class PublicRelease implements Serializable {
      */
     private Integer newUser;
 
+    /**
+     * 签单数
+     */
+    private Integer signSum;
+
+    /**
+     * 0辅助根据 1主要跟进
+     */
+    private Integer mainStatus;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -279,4 +289,20 @@ public class PublicRelease implements Serializable {
     public void setNewUser(Integer newUser) {
         this.newUser = newUser;
     }
+
+    public Integer getSignSum() {
+        return signSum;
+    }
+
+    public void setSignSum(Integer signSum) {
+        this.signSum = signSum;
+    }
+
+    public Integer getMainStatus() {
+        return mainStatus;
+    }
+
+    public void setMainStatus(Integer mainStatus) {
+        this.mainStatus = mainStatus;
+    }
 }

+ 0 - 1
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -2053,7 +2053,6 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 				y = 100;
 				break;
 			}
-
 		}
 
 		if (i >= y) {

+ 0 - 5
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -229,11 +229,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		t.setCreateTime(new Date());
 		t.setUpdateTime(new Date());
 		t.setBuyerId(uid);
-		t.setNewUser(0);
-		if(uid!=null){
-			int i=userMapper.checkNewUser(uid);
-			if (i==1)t.setNewUser(1);
-		}
 		TOrderExtend te=new TOrderExtend();
 		te.setOrderNo(orderNo);
 		te.setServiceStatus(0);

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

@@ -13,6 +13,7 @@ import java.util.UUID;
 
 import javax.mail.MessagingException;
 
+import com.goafanti.common.dao.*;
 import org.apache.commons.collections4.map.HashedMap;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -29,32 +30,6 @@ import com.goafanti.common.bo.UserOrderTask;
 import com.goafanti.common.bo.paymentNodeEmailBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
-import com.goafanti.common.dao.AdminMapper;
-import com.goafanti.common.dao.BusinessProjectMapper;
-import com.goafanti.common.dao.NewOrderDunMapper;
-import com.goafanti.common.dao.OrganizationContactBookMapper;
-import com.goafanti.common.dao.OrganizationIdentityMapper;
-import com.goafanti.common.dao.PaymentNodeMapper;
-import com.goafanti.common.dao.ProjcetCheckLogMapper;
-import com.goafanti.common.dao.TArrearsDunMapper;
-import com.goafanti.common.dao.TOrderBonusMapper;
-import com.goafanti.common.dao.TOrderLogMapper;
-import com.goafanti.common.dao.TOrderMidMapper;
-import com.goafanti.common.dao.TOrderNewMapper;
-import com.goafanti.common.dao.TOrderPaymentMapper;
-import com.goafanti.common.dao.TOrderTaskMapper;
-import com.goafanti.common.dao.TTaskHoursMapper;
-import com.goafanti.common.dao.TTaskLogMapper;
-import com.goafanti.common.dao.TTaskMidMapper;
-import com.goafanti.common.dao.TaskAttributionLogMapper;
-import com.goafanti.common.dao.TaskHoursCountMapper;
-import com.goafanti.common.dao.TaskLogMapper;
-import com.goafanti.common.dao.TaskProgressLogMapper;
-import com.goafanti.common.dao.TaskProgressMapper;
-import com.goafanti.common.dao.UserBusinessMapper;
-import com.goafanti.common.dao.UserChannelMapper;
-import com.goafanti.common.dao.UserLockReleaseMapper;
-import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.enums.ChannelStatus;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.OrderLogProcess;
@@ -171,6 +146,8 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	@Autowired
 	private TOrderPaymentMapper	tOrderPaymentMapper;
 	@Autowired
+	private PublicReleaseMapper	publicReleaseMapper;
+	@Autowired
 	private AsyncUtils	asyncUtils;
 	@Value(value = "${upload.path}")
 	private String 					uploadPath 			= null;
@@ -253,13 +230,14 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			ub.setRemarks("派单自动锁定客户");
 			ub.setBusinessProjectId(t.getCommodityId());
 			userBusinessMapper.insertSelective(ub);
-			
 			//如果是渠道客户更新渠道表
 			UserChannel uc=new UserChannel();
 			uc.setUid(tn.getBuyerId());
 			uc.setStatus(ChannelStatus.YQD.getCode());
 			uc.setSignTime(date);
 			userChannelMapper.updateByUid(uc);
+			//标记最新的打卡
+			publicReleaseMapper.updateSignByAidAndUid(tn.getBuyerId(),tn.getSalesmanId());
 	}
 	
 	

+ 1 - 1
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -72,7 +72,7 @@ public class AdminReleaseApiController extends CertifyApiController{
 	}
 
 	/**
-	 * 外出打卡
+	 * 外出打卡、公出打卡
 	 * @return
 	 */
 	@RequestMapping(value = "/publicReleaseClockIn", method = RequestMethod.POST)

+ 7 - 4
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -79,9 +79,12 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		in.setStatus(1);
 		in.setAid(TokenManager.getAdminId());
 		in.setNewUser(0);
-		if(in.getUid()!=null){
-			int i=userMapper.checkNewUser(in.getUid());
-			if (i==1)in.setNewUser(1);
+		User u=userMapper.selectByPrimaryKey(in.getUid());
+		if (u!=null&&u.getShareType()==2){
+			in.setNewUser(1);
+		}
+		if (u.getAid().equals(TokenManager.getAdminId())){
+			in.setMainStatus(1);
 		}
 		publicReleaseMapper.insertSelectiveGetId(in);
 		AdminListBo my = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
@@ -89,7 +92,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		PublicReleaseLog log=new PublicReleaseLog(in.getId(),TokenManager.getAdminId(),1,"发起外出申请",new Date());
 		publicReleaseLogMapper.insertSelective(log);
 		String openid=a.getOpenId();
-		User u=userMapper.selectByPrimaryKey(in.getUid());
+
 		String str="["+my.getName()+"]发起["+u.getNickname()+"]的外出申请,请及时审核。";
 		sendNoticeAndSoucket(a.getId(),NoticeStatus.PUBLIC_RELEASE_START.getCode(),str);
 		Map<String, Object>map=new HashMap<String, Object>();

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

@@ -1,6 +1,6 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
-jdbc.url=jdbc\:mysql://localhost:3306/aft20210820?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
 jdbc.password=123456
 #jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false