Commit 57f69c8f by jinxin

待转移状态的许可激活码不需要处理

parent 3c9408f8
......@@ -187,5 +187,7 @@ public interface StaffMapper {
* @return
*/
List<String> queryStaffIdsWithEnterpriseId(@Param("wxEnterpriseIds") List<String> wxEnterpriseIds);
Integer getNumByActiveCode(@Param("wxEnterpriseId") String wxEnterpriseId,@Param("activeCode")String activeCode);
}
\ No newline at end of file
......@@ -1189,19 +1189,23 @@ public class StaffApiServiceImpl implements StaffApiService {
if (null == activeDataDTO){
logger.info("查询不到企业微信id->{}的许可账号统计信息!",wxEnterprise.getWxEnterpriseId());
}else {
//已使用的加1,已激活的加1,未激活的减1
Integer used = activeDataDTO.getUsed();
Integer inactive = activeDataDTO.getInactive();
Integer activated = activeDataDTO.getActivated();
used++;
activated++;
if(null != inactive && inactive > 0){
inactive--;
//需要区分激活码,待转移状态的激活码不需要处理
Integer num = staffMapper.getNumByActiveCode(wxEnterprise.getWxEnterpriseId(), activeCode);
if (num>0){
//已使用的加1,已激活的加1,未激活的减1
Integer used = activeDataDTO.getUsed();
Integer inactive = activeDataDTO.getInactive();
Integer activated = activeDataDTO.getActivated();
used++;
activated++;
if(null != inactive && inactive > 0){
inactive--;
}
activeDataDTO.setUsed(used);
activeDataDTO.setInactive(inactive);
activeDataDTO.setActivated(activated);
wxEnterpriseActiveDataService.updateByStaffActiveDataDTO(activeDataDTO);
}
activeDataDTO.setUsed(used);
activeDataDTO.setInactive(inactive);
activeDataDTO.setActivated(activated);
wxEnterpriseActiveDataService.updateByStaffActiveDataDTO(activeDataDTO);
}
}
return com.gic.api.base.commons.ServiceResponse.success(true);
......
......@@ -646,5 +646,8 @@
#{wxEnterpriseId}
</foreach>
</select>
<select id="getNumByActiveCode" resultType="java.lang.Integer">
SELECT count(*) FROM tab_haoban_staff WHERE wx_enterprise_id = #{wxEnterpriseId} and active_code = #{activeCode}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment